1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-24 00:03:11 +01:00

Ignore UI-only flag in sprite checksum

Ignore peep.window_invalidate_flags in sprite checksum to prevent
false positivie desync alerts, flag does not affect game state.
This commit is contained in:
ZehM4tt
2017-06-18 11:10:49 +02:00
committed by Michał Janiszewski
parent 10740106f2
commit def76edd55
2 changed files with 7 additions and 1 deletions

View File

@@ -56,7 +56,7 @@ extern "C" {
// This define specifies which version of network stream current build uses.
// It is used for making sure only compatible builds get connected, even within
// single OpenRCT2 version.
#define NETWORK_STREAM_VERSION "17"
#define NETWORK_STREAM_VERSION "18"
#define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION
#ifdef __cplusplus

View File

@@ -212,6 +212,12 @@ const char * sprite_checksum()
rct_sprite copy = *sprite;
copy.unknown.sprite_left = copy.unknown.sprite_right = copy.unknown.sprite_top = copy.unknown.sprite_bottom = 0;
if (copy.unknown.sprite_identifier == SPRITE_IDENTIFIER_PEEP) {
// We set this to 0 because as soon the client selects a guest the window will remove the
// invalidation flags causing the sprite checksum to be different than on server, the flag does not affect game state.
copy.peep.window_invalidate_flags = 0;
}
if (EVP_DigestUpdate(gHashCTX, &copy, sizeof(rct_sprite)) <= 0)
{
openrct2_assert(false, "Failed to update digest");