summaryrefslogtreecommitdiff
path: root/src/vehicle.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-08-31 20:52:38 +0000
committerrubidium <rubidium@openttd.org>2007-08-31 20:52:38 +0000
commit57db6a8c20e3d907781398dfcb119345f750571f (patch)
treea07237e50c275d462dbd4bcccd061d7fad21e8f4 /src/vehicle.cpp
parent10475e88c620a245794244d27189af53bdd1fa35 (diff)
downloadopenttd-57db6a8c20e3d907781398dfcb119345f750571f.tar.xz
(svn r11027) -Fix: do not unconditionally assume that a tile has a depot.
Diffstat (limited to 'src/vehicle.cpp')
-rw-r--r--src/vehicle.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp
index 003f21b47..fc4b1ebff 100644
--- a/src/vehicle.cpp
+++ b/src/vehicle.cpp
@@ -1634,7 +1634,7 @@ CommandCost CmdDepotMassAutoReplace(TileIndex tile, uint32 flags, uint32 p1, uin
CommandCost cost;
VehicleType vehicle_type = (VehicleType)GB(p1, 0, 8);
- if (!IsTileOwner(tile, _current_player)) return CMD_ERROR;
+ if (!IsDepotTile(tile) || !IsTileOwner(tile, _current_player)) return CMD_ERROR;
/* Get the list of vehicles in the depot */
BuildDepotVehicleList(vehicle_type, tile, &vl, &engine_list_length, &engine_count, NULL, NULL, NULL);