summaryrefslogtreecommitdiff
path: root/roadveh_cmd.c
diff options
context:
space:
mode:
Diffstat (limited to 'roadveh_cmd.c')
-rw-r--r--roadveh_cmd.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/roadveh_cmd.c b/roadveh_cmd.c
index 7d469579b..ba3545e22 100644
--- a/roadveh_cmd.c
+++ b/roadveh_cmd.c
@@ -133,7 +133,7 @@ int32 CmdBuildRoadVeh(int x, int y, uint32 flags, uint32 p1, uint32 p2)
/* The ai_new queries the vehicle cost before building the route,
* so we must check against cheaters no sooner than now. --pasky */
if (!IsTileDepotType(tile, TRANSPORT_ROAD)) return CMD_ERROR;
- if (_map_owner[tile] != _current_player) return CMD_ERROR;
+ if (!IsTileOwner(tile, _current_player)) return CMD_ERROR;
v = AllocateVehicle();
if (v == NULL || IsOrderPoolFull())
@@ -297,7 +297,7 @@ static bool EnumRoadSignalFindDepot(uint tile, RoadFindDepotData *rfdd, int trac
if (IsTileType(tile, MP_STREET) &&
(_map5[tile] & 0xF0) == 0x20 &&
- _map_owner[tile] == rfdd->owner) {
+ IsTileOwner(tile, rfdd->owner)) {
if (length < rfdd->best_length) {
rfdd->best_length = length;
@@ -1048,11 +1048,11 @@ static int RoadFindPathToDest(Vehicle *v, uint tile, int enterdir)
}
if (IsTileType(tile, MP_STREET)) {
- if ((_map5[tile]&0xF0) == 0x20 && v->owner == _map_owner[tile])
+ if ((_map5[tile]&0xF0) == 0x20 && IsTileOwner(tile, v->owner))
/* Road crossing */
bitmask |= _road_veh_fp_ax_or[_map5[tile]&3];
} else if (IsTileType(tile, MP_STATION)) {
- if (_map_owner[tile] == OWNER_NONE || _map_owner[tile] == v->owner) {
+ if (IsTileOwner(tile, OWNER_NONE) || IsTileOwner(tile, v->owner)) {
/* Our station */
Station *st = GetStation(_map2[tile]);
byte val = _map5[tile];