summaryrefslogtreecommitdiff
path: root/order_gui.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 /order_gui.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 'order_gui.c')
-rw-r--r--order_gui.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/order_gui.c b/order_gui.c
index 136153794..2840740cf 100644
--- a/order_gui.c
+++ b/order_gui.c
@@ -167,7 +167,7 @@ static Order GetOrderCmdFromTile(Vehicle *v, uint tile)
if (_patches.gotodepot) {
switch (GetTileType(tile)) {
case MP_RAILWAY:
- if (v->type == VEH_Train && _map_owner[tile] == _local_player) {
+ if (v->type == VEH_Train && IsTileOwner(tile, _local_player)) {
if ((_map5[tile]&0xFC)==0xC0) {
order.type = OT_GOTO_DEPOT;
order.flags = OF_PART_OF_ORDERS;
@@ -178,7 +178,7 @@ static Order GetOrderCmdFromTile(Vehicle *v, uint tile)
break;
case MP_STREET:
- if ((_map5[tile] & 0xF0) == 0x20 && v->type == VEH_Road && _map_owner[tile] == _local_player) {
+ if ((_map5[tile] & 0xF0) == 0x20 && v->type == VEH_Road && IsTileOwner(tile, _local_player)) {
order.type = OT_GOTO_DEPOT;
order.flags = OF_PART_OF_ORDERS;
order.station = GetDepotByTile(tile)->index;
@@ -188,7 +188,7 @@ static Order GetOrderCmdFromTile(Vehicle *v, uint tile)
case MP_STATION:
if (v->type != VEH_Aircraft) break;
- if ( IsAircraftHangarTile(tile) && _map_owner[tile] == _local_player) {
+ if (IsAircraftHangarTile(tile) && IsTileOwner(tile, _local_player)) {
order.type = OT_GOTO_DEPOT;
order.flags = OF_PART_OF_ORDERS | OF_NON_STOP; //XXX - whats the nonstop stuff doing here?
order.station = _map2[tile];
@@ -216,10 +216,10 @@ static Order GetOrderCmdFromTile(Vehicle *v, uint tile)
}
// check waypoint
- if (IsTileType(tile, MP_RAILWAY)
- && v->type == VEH_Train
- && _map_owner[tile] == _local_player
- && (_map5[tile]&0xFE)==0xC4) {
+ if (IsTileType(tile, MP_RAILWAY) &&
+ v->type == VEH_Train &&
+ IsTileOwner(tile, _local_player) &&
+ (_map5[tile] & 0xFE) == 0xC4) {
order.type = OT_GOTO_WAYPOINT;
order.flags = 0;
order.station = GetWaypointByTile(tile)->index;