Merge pull request #2448 from myk002/myk_init_statics

fix crash in buildingplan
develop
Myk 2022-11-30 06:58:16 -08:00 committed by GitHub
commit 148a623c03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

@ -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

@ -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;