diff --git a/docs/changelog.txt b/docs/changelog.txt index 49a5eee0b..eba204e64 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -38,6 +38,7 @@ changelog.txt uses a syntax similar to RST, with a few special sequences: ## Fixes - `automaterial`: fix the cursor jumping up a z level when clicking quickly after box select +- `buildingplan`: fix crash when canceling out of placement of a building with plan mode enabled and subsequently attempting to place a building that does not have plan mode enabled and that has no pertinent materials available - `gui/create-item`: prevent materials list filter from intercepting sublist hotkeys - `mousequery`: fix the cursor jumping up z levels sometimes when using TWBT - `tiletypes`: no longer resets dig priority to the default when updating other properties of a tile diff --git a/plugins/buildingplan.cpp b/plugins/buildingplan.cpp index b13c8daa3..1e1866ddd 100644 --- a/plugins/buildingplan.cpp +++ b/plugins/buildingplan.cpp @@ -734,6 +734,8 @@ struct buildingplan_place_hook : public df::viewscreen_dwarfmodest DEFINE_VMETHOD_INTERPOSE(void, render, ()) { + initStatics(); + bool plannable = isInPlannedBuildingPlacementMode(); if (plannable && is_planmode_enabled(key)) { @@ -759,8 +761,6 @@ struct buildingplan_place_hook : public df::viewscreen_dwarfmodest if (!plannable) return; - initStatics(); - auto dims = Gui::getDwarfmodeViewDims(); int left_margin = dims.menu_x1 + 1; int x = left_margin;