From db5ed118f6065969910b879acbde0c02b95f8f3f Mon Sep 17 00:00:00 2001 From: Nikolay Borodin Date: Wed, 20 Nov 2024 23:42:44 +0200 Subject: [PATCH] Fixed wall gate flickering when in construction state --- src/hci.cpp | 2 +- src/structure.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hci.cpp b/src/hci.cpp index bb4f0aeed91..0a39e5ebd11 100644 --- a/src/hci.cpp +++ b/src/hci.cpp @@ -1714,7 +1714,6 @@ INT_RETVAL intRunWidgets() if (psBuilding->type == REF_DEMOLISH) { - STRUCTURE tmp(0, selectedPlayer); MAPTILE *psTile = mapTile(map_coord(pos.x), map_coord(pos.y)); FEATURE *psFeature = (FEATURE *)psTile->psObject; STRUCTURE *psStructure = (STRUCTURE *)psTile->psObject; @@ -1733,6 +1732,7 @@ INT_RETVAL intRunWidgets() { STRUCTURE tmp(generateNewObjectId(), selectedPlayer); STRUCTURE *psStructure = &tmp; + tmp.state = SAS_NORMAL; tmp.pStructureType = (STRUCTURE_STATS *)psPositionStats; tmp.pos = {pos.x, pos.y, map_Height(pos.x, pos.y) + world_coord(1) / 10}; diff --git a/src/structure.cpp b/src/structure.cpp index 6e5b4477a58..9c81fa1500a 100644 --- a/src/structure.cpp +++ b/src/structure.cpp @@ -1971,6 +1971,7 @@ optional buildBlueprint(STRUCTURE_STATS const *psStats, Vector3i pos, } STRUCTURE blueprint(0, ownerPlayer); + blueprint.state = SAS_NORMAL; // construct the fake structure blueprint.pStructureType = const_cast(psStats); // Couldn't be bothered to fix const correctness everywhere. if (selectedPlayer < MAX_PLAYERS)