diff options
author | tron <tron@openttd.org> | 2005-06-04 11:56:32 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2005-06-04 11:56:32 +0000 |
commit | 0c4ecbe9ece42d071a4f4e4b6d506be32030cb4c (patch) | |
tree | 172ef15bca6626b797fbf586a043a978ee884141 /ai_new.c | |
parent | 19e2b40a788cc175f35e4ca0cec0f439bd46ab76 (diff) | |
download | openttd-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 'ai_new.c')
-rw-r--r-- | ai_new.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -763,7 +763,7 @@ static void AiNew_State_FindDepot(Player *p) { // Its a street, test if it is a depot if (_map5[tile + TileOffsByDir(j)] & 0x20) { // We found a depot, is it ours? (TELL ME!!!) - if (_map_owner[tile + TileOffsByDir(j)] == _current_player) { + if (IsTileOwner(tile + TileOffsByDir(j), _current_player)) { // Now, is it pointing to the right direction......... if ((_map5[tile + TileOffsByDir(j)] & 3) == (j ^ 2)) { // Yeah!!! @@ -1062,7 +1062,7 @@ static void AiNew_State_BuildDepot(Player *p) { assert(p->ainew.state == AI_STATE_BUILD_DEPOT); if (IsTileType(p->ainew.depot_tile, MP_STREET) && _map5[p->ainew.depot_tile] & 0x20) { - if (_map_owner[p->ainew.depot_tile] == _current_player) { + if (IsTileOwner(p->ainew.depot_tile, _current_player)) { // The depot is already builded! p->ainew.state = AI_STATE_BUILD_VEHICLE; return; |