Skip to content

Commit

Permalink
Crash prevention for structureBuildDir()
Browse files Browse the repository at this point in the history
  • Loading branch information
KJeff01 committed Feb 21, 2024
1 parent 0fd36e2 commit 1c1da15
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/structure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1500,7 +1500,7 @@ STRUCTURE *buildStructureDir(STRUCTURE_STATS *pStructureType, UDWORD x, UDWORD y
psTile->psObject = psBuilding;

// if it's a tall structure then flag it in the map.
if (psBuilding->sDisplay.imd->max.y > TALLOBJECT_YMAX)
if (psBuilding->sDisplay.imd && psBuilding->sDisplay.imd->max.y > TALLOBJECT_YMAX)
{
auxSetBlocking(tileX, tileY, AIR_BLOCKED);
}
Expand Down

0 comments on commit 1c1da15

Please sign in to comment.