When I save a game and return to the title screen, I see the following sequence of events:
game state changed: SC_VIEWSCREEN_CHANGED
save or unload is imminent; time to persist state
game state changed: SC_MAP_UNLOADED
Loading script: dfhack-config/init/default.onMapUnload.init
Loading script: hack/init/onMapUnload.default.init
Loading script: dfhack-config/init/onMapUnload.init
game state changed: SC_WORLD_UNLOADED
Loading script: dfhack-config/init/default.onUnload.init
Loading script: hack/init/onUnload.default.init
Loading script: dfhack-config/init/onUnload.init
game state changed: SC_VIEWSCREEN_CHANGED
Which is all expected. However, they are immediately followed by this when the transition to the title screen happens:
world is loading; time to load persisted state
game state changed: SC_WORLD_LOADED
Loading script: dfhack-config/init/default.onLoad.init
Loading script: hack/init/onLoad.default.init
Loading script: dfhack-config/init/onLoad.init
game state changed: SC_MAP_LOADED
Loading script: dfhack-config/init/default.onMapLoad.init
Loading script: hack/init/onMapLoad.default.init
Loading script: dfhack-config/init/onMapLoad.init
Loading script: dfhack-config/init/onMapLoad.control-panel-new-fort.init
Loading script: dfhack-config/init/onMapLoad.control-panel-repeats.init
combine needs a loaded fortress map to work
game state changed: SC_VIEWSCREEN_CHANGED
game state changed: SC_MAP_UNLOADED
Loading script: dfhack-config/init/default.onMapUnload.init
Loading script: hack/init/onMapUnload.default.init
Loading script: dfhack-config/init/onMapUnload.init
game state changed: SC_WORLD_UNLOADED
Loading script: dfhack-config/init/default.onUnload.init
Loading script: hack/init/onUnload.default.init
Loading script: dfhack-config/init/onUnload.init
So it looks like we erroneously detect a world load event happening and follow it up immediately with another world unload.
When I save a game and return to the title screen, I see the following sequence of events:
Which is all expected. However, they are immediately followed by this when the transition to the title screen happens:
So it looks like we erroneously detect a world load event happening and follow it up immediately with another world unload.