From 0c4ecbe9ece42d071a4f4e4b6d506be32030cb4c Mon Sep 17 00:00:00 2001 From: tron Date: Sat, 4 Jun 2005 11:56:32 +0000 Subject: (svn r2407) Use {Get,Is}TileOwner to get/check the owner of a tile and fix some bogus reads of _map_owner --- clear_cmd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'clear_cmd.c') 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) -- cgit v1.2.3-54-g00ecf