Skip to content

Commit

Permalink
Fix: auxStructureNonblocking() for script-queued object removal
Browse files Browse the repository at this point in the history
Where the script immediately replaced the old struct
  • Loading branch information
past-due committed Jun 24, 2024
1 parent 721e6b6 commit 14b5035
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/structure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,18 @@ static void auxStructureNonblocking(STRUCTURE *psStructure)
{
for (int j = 0; j < b.size.y; j++)
{
auxClearAll(b.map.x + i, b.map.y + j, AUXBITS_BLOCKING | AUXBITS_OUR_BUILDING | AUXBITS_NONPASSABLE);
int x = b.map.x + i;
int y = b.map.y + j;
MAPTILE *psTile = mapTile(x, y);
if (psTile->psObject == psStructure)
{
auxClearAll(x, y, AUXBITS_BLOCKING | AUXBITS_OUR_BUILDING | AUXBITS_NONPASSABLE);
}
else
{
// Likely a script-queued object removal for a position where the script immediately replaced the old struct - just log
debug(LOG_WZ, "Skipping blocking bit clear - structure %" PRIu32 " is not the recorded tile object at (%d, %d)", psStructure->id, x, y);
}
}
}
}
Expand Down

0 comments on commit 14b5035

Please sign in to comment.