Don't checksum elements with BACKGROUND_OBJECT set. Allows for certain types
of graphics mods which don't influence netplay synchronisation. git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2793 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -70,6 +70,11 @@ typedef HLINK HELEMENT;
|
||||
#define IGNORE_VELOCITY (1 << 13)
|
||||
#define CREW_OBJECT (1 << 14)
|
||||
#define BACKGROUND_OBJECT (1 << 15)
|
||||
// The BACKGROUND_OBJECT flag existed originally but wasn't used.
|
||||
// It can now be used for objects that never influence the state
|
||||
// of other elements; elements that have this flag set are not
|
||||
// included in the checksum used for netplay games.
|
||||
// It can be used for graphical mods that don't impede netplay.
|
||||
|
||||
|
||||
#define HYPERJUMP_LIFE 15
|
||||
|
||||
@@ -109,6 +109,13 @@ crc_processELEMENT(crc_State *state, const ELEMENT *val) {
|
||||
#ifdef DUMP_CRC_OPS
|
||||
crc_log("START crc_processELEMENT().");
|
||||
#endif
|
||||
if (val->state_flags & BACKGROUND_OBJECT) {
|
||||
// The element never influences the state of other elements,
|
||||
// and is to be excluded from checksums.
|
||||
#ifdef DUMP_CRC_OPS
|
||||
crc_log(" BACKGROUND_OBJECT element omited");
|
||||
#endif
|
||||
} else {
|
||||
crc_processELEMENT_FLAGS(state, val->state_flags);
|
||||
crc_processCOUNT(state, val->life_span);
|
||||
crc_processCOUNT(state, val->crew_level);
|
||||
@@ -131,6 +138,7 @@ crc_processELEMENT(crc_State *state, const ELEMENT *val) {
|
||||
crc_processVELOCITY_DESC(state, &val->velocity);
|
||||
crc_processSTATE(state, &val->current);
|
||||
crc_processSTATE(state, &val->next);
|
||||
}
|
||||
#ifdef DUMP_CRC_OPS
|
||||
crc_log("END crc_processELEMENT().");
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user