forked from mirror/OpenTTD
(svn r2407) Use {Get,Is}TileOwner to get/check the owner of a tile and fix some bogus reads of _map_owner
This commit is contained in:
4
ai_new.c
4
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;
|
||||
|
Reference in New Issue
Block a user