summaryrefslogtreecommitdiff
path: root/ai_new.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 /ai_new.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 'ai_new.c')
-rw-r--r--ai_new.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ai_new.c b/ai_new.c
index 93b7c20ef..b10f316b3 100644
--- a/ai_new.c
+++ b/ai_new.c
@@ -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;