Merge remote-tracking branch 'myk002/myk_bad_bad_statics' into develop

develop
lethosor 2020-11-12 10:43:52 -05:00
commit 7958c1f9e3
No known key found for this signature in database
GPG Key ID: 76A269552F4F58C1
1 changed files with 12 additions and 0 deletions

@ -457,6 +457,11 @@ struct buildingplan_query_hook : public df::viewscreen_dwarfmodest
}
}
static void invalidateStatics()
{
bld = NULL;
}
bool handleInput(set<df::interface_key> *input)
{
if (!isInPlannedBuildingQueryMode() || Gui::inRenameBuilding())
@ -583,6 +588,11 @@ struct buildingplan_place_hook : public df::viewscreen_dwarfmodest
}
}
static void invalidateStatics()
{
key = BuildingTypeKey();
}
bool handleInput(set<df::interface_key> *input)
{
if (!isInPlannedBuildingPlacementMode())
@ -959,6 +969,8 @@ DFhackCExport command_result plugin_onstatechange(color_ostream &out, state_chan
{
switch (event) {
case SC_MAP_LOADED:
buildingplan_place_hook::invalidateStatics();
buildingplan_query_hook::invalidateStatics();
planner.reset();
roomMonitor.reset(out);
break;