mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-09 19:10:38 +00:00
Fix #9527: Crash when trying to place multitile objects at map edge
This commit is contained in:
parent
16dca0d7bc
commit
d4588df9f9
@ -220,6 +220,9 @@ CommandCost CmdBuildObject(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
|
|||||||
int size_x = GB(spec->size, HasBit(view, 0) ? 4 : 0, 4);
|
int size_x = GB(spec->size, HasBit(view, 0) ? 4 : 0, 4);
|
||||||
int size_y = GB(spec->size, HasBit(view, 0) ? 0 : 4, 4);
|
int size_y = GB(spec->size, HasBit(view, 0) ? 0 : 4, 4);
|
||||||
TileArea ta(tile, size_x, size_y);
|
TileArea ta(tile, size_x, size_y);
|
||||||
|
for (TileIndex t : ta) {
|
||||||
|
if (!IsValidTile(t)) return_cmd_error(STR_ERROR_TOO_CLOSE_TO_EDGE_OF_MAP_SUB); // Might be off the map
|
||||||
|
}
|
||||||
|
|
||||||
if (type == OBJECT_OWNED_LAND) {
|
if (type == OBJECT_OWNED_LAND) {
|
||||||
/* Owned land is special as it can be placed on any slope. */
|
/* Owned land is special as it can be placed on any slope. */
|
||||||
|
Loading…
Reference in New Issue
Block a user