From 6c9b94bcef458d68fab5dab3f60b993695b7315a Mon Sep 17 00:00:00 2001 From: Eric Wald Date: Tue, 30 Sep 2014 23:02:35 -0600 Subject: [PATCH] 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... --- library/Core.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/library/Core.cpp b/library/Core.cpp index b6ae13ae1..27adf8393 100644 --- a/library/Core.cpp +++ b/library/Core.cpp @@ -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 @@ -1280,6 +1281,7 @@ void Core::doUpdate(color_ostream &out, bool first_update) } bool is_load_save = + strict_virtual_cast(screen) || strict_virtual_cast(screen) || strict_virtual_cast(screen);