mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-15 19:13:07 +01:00
Reduce false positive desync
The staff list window modifies the sprites purely for local state causing a false positive desync warning to pop up in multiplayer. This now causes it to only happen if the map window is also open. This is also a performance improvement. #5164
This commit is contained in:
@@ -316,15 +316,21 @@ void window_staff_list_update(rct_window *w)
|
||||
if (w->list_information_type >= 24) {
|
||||
w->list_information_type = 0;
|
||||
} else {
|
||||
sint32 spriteIndex;
|
||||
rct_peep *peep;
|
||||
widget_invalidate(w, WIDX_STAFF_LIST_HANDYMEN_TAB + _windowStaffListSelectedTab);
|
||||
gWindowMapFlashingFlags |= (1 << 2);
|
||||
FOR_ALL_STAFF(spriteIndex, peep) {
|
||||
peep->flags &= ~(SPRITE_FLAGS_PEEP_FLASHING);
|
||||
|
||||
if (peep->staff_type == _windowStaffListSelectedTab) {
|
||||
peep->flags |= SPRITE_FLAGS_PEEP_FLASHING;
|
||||
// Enable highlighting of these staff members in map window
|
||||
if (window_find_by_class(WC_MAP) != NULL) {
|
||||
sint32 spriteIndex;
|
||||
rct_peep * peep;
|
||||
gWindowMapFlashingFlags |= (1 << 2);
|
||||
FOR_ALL_STAFF(spriteIndex, peep) {
|
||||
// TODO When possible, do not modify the peep state as it shows up as a
|
||||
// multiplayer desynchronisation
|
||||
peep->flags &= ~(SPRITE_FLAGS_PEEP_FLASHING);
|
||||
|
||||
if (peep->staff_type == _windowStaffListSelectedTab) {
|
||||
peep->flags |= SPRITE_FLAGS_PEEP_FLASHING;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user