Skip to content

Commit

Permalink
Fixed wall gate flickering when in construction state
Browse files Browse the repository at this point in the history
  • Loading branch information
Monsterovich committed Nov 20, 2024
1 parent 96ce8bf commit db5ed11
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/hci.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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};

Expand Down
1 change: 1 addition & 0 deletions src/structure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1971,6 +1971,7 @@ optional<STRUCTURE> buildBlueprint(STRUCTURE_STATS const *psStats, Vector3i pos,
}

STRUCTURE blueprint(0, ownerPlayer);
blueprint.state = SAS_NORMAL;
// construct the fake structure
blueprint.pStructureType = const_cast<STRUCTURE_STATS *>(psStats); // Couldn't be bothered to fix const correctness everywhere.
if (selectedPlayer < MAX_PLAYERS)
Expand Down

0 comments on commit db5ed11

Please sign in to comment.