Removing duplicate world and map loading events.

Saving a game in progress now goes through an extra viewscreen before reaching the condition that had been used to indicate whether the world was still valid, causing the core to emit bogus WORLD_LOADED, MAP_LOADED, MAP_UNLOADED, and WORLD_UNLOADED events.  Adding that viewscreen to the list of loading/saving screens prevents those duplicate events from firing.

Granted, if the game_cleaner viewscreen ever gets hit in play, this fix will cause more bogus events...
develop
Eric Wald 2014-09-30 23:02:35 -06:00
parent b0b6a82c92
commit 6c9b94bcef
1 changed files with 2 additions and 0 deletions

@ -61,6 +61,7 @@ using namespace DFHack;
#include "df/world_data.h"
#include "df/interfacest.h"
#include "df/viewscreen_dwarfmodest.h"
#include "df/viewscreen_game_cleanerst.h"
#include "df/viewscreen_loadgamest.h"
#include "df/viewscreen_savegamest.h"
#include <df/graphic.h>
@ -1280,6 +1281,7 @@ void Core::doUpdate(color_ostream &out, bool first_update)
}
bool is_load_save =
strict_virtual_cast<df::viewscreen_game_cleanerst>(screen) ||
strict_virtual_cast<df::viewscreen_loadgamest>(screen) ||
strict_virtual_cast<df::viewscreen_savegamest>(screen);