summaryrefslogtreecommitdiff
path: root/clear_cmd.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-06-04 11:56:32 +0000
committertron <tron@openttd.org>2005-06-04 11:56:32 +0000
commit0c4ecbe9ece42d071a4f4e4b6d506be32030cb4c (patch)
tree172ef15bca6626b797fbf586a043a978ee884141 /clear_cmd.c
parent19e2b40a788cc175f35e4ca0cec0f439bd46ab76 (diff)
downloadopenttd-0c4ecbe9ece42d071a4f4e4b6d506be32030cb4c.tar.xz
(svn r2407) Use {Get,Is}TileOwner to get/check the owner of a tile and fix some bogus reads of _map_owner
Diffstat (limited to 'clear_cmd.c')
-rw-r--r--clear_cmd.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/clear_cmd.c b/clear_cmd.c
index 124723fec..d9cb1b5a9 100644
--- a/clear_cmd.c
+++ b/clear_cmd.c
@@ -399,7 +399,8 @@ int32 CmdPurchaseLandArea(int x, int y, uint32 flags, uint32 p1, uint32 p2)
if (!EnsureNoVehicle(tile)) return CMD_ERROR;
- if (IsTileType(tile, MP_UNMOVABLE) && _map5[tile] == 3 && _map_owner[tile] == _current_player)
+ if (IsTileType(tile, MP_UNMOVABLE) && _map5[tile] == 3 &&
+ IsTileOwner(tile, _current_player))
return_cmd_error(STR_5807_YOU_ALREADY_OWN_IT);
cost = DoCommandByTile(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
@@ -837,7 +838,7 @@ static void GetTileDesc_Clear(uint tile, TileDesc *td)
if (i == 0)
i = (_map5[tile] & 3) + 8;
td->str = _clear_land_str[i - 1];
- td->owner = _map_owner[tile];
+ td->owner = GetTileOwner(tile);
}
static void ChangeTileOwner_Clear(uint tile, byte old_player, byte new_player)