From 5138bc419d9ae0e7d3c1dac464b049323def8317 Mon Sep 17 00:00:00 2001 From: flan Date: Thu, 7 Aug 2025 12:36:58 +0200 Subject: [PATCH] Erase synced picture when overwritten by non-synced picture A common example of synced pictures staying around due to being overwritten is the 2kki "stuck MIX" phenomenon, reproducible by switching to a mix effect and then opening the shift menu before the effect animation disappears. The shift menu reuses the picture IDs and doesn't bother erasing the existing pictures. --- src/multiplayer/game_multiplayer.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/multiplayer/game_multiplayer.cpp b/src/multiplayer/game_multiplayer.cpp index ccd8688e9..fdb217728 100644 --- a/src/multiplayer/game_multiplayer.cpp +++ b/src/multiplayer/game_multiplayer.cpp @@ -681,11 +681,16 @@ bool Game_Multiplayer::IsPictureSynced(int pic_id, std::string_view pic_name) { } void Game_Multiplayer::PictureShown(int pic_id, Game_Pictures::ShowParams& params) { + // IsPictureSynced overwrites sync_picture_cache data so we have to retrieve it beforehand + bool was_synced = sync_picture_cache.count(pic_id) && sync_picture_cache[pic_id]; if (IsPictureSynced(pic_id, params.name)) { auto& p = Main_Data::game_player; connection.SendPacketAsync(pic_id, params, Game_Map::GetPositionX(), Game_Map::GetPositionY(), p->GetPanX(), p->GetPanY()); + } else if (was_synced) { + sync_picture_cache.erase(pic_id); + connection.SendPacketAsync(pic_id); } }