diff options
author | bjarni <bjarni@openttd.org> | 2006-09-27 15:40:55 +0000 |
---|---|---|
committer | bjarni <bjarni@openttd.org> | 2006-09-27 15:40:55 +0000 |
commit | fcc39c454af988d11caf032fcc7daa659fabb753 (patch) | |
tree | 9ddb344d69511b78f91340dbf576a2d01a61517c /depot_gui.c | |
parent | 9c3e5266312193a6e023143ec35144baa598283e (diff) | |
download | openttd-fcc39c454af988d11caf032fcc7daa659fabb753.tar.xz |
(svn r6529) -Fix r6513: [depot window] added missing switch in CcCloneVehicle()
The result of this missing switch was asserts in some cloning conditions (not all) (spotted by KUDr)
Diffstat (limited to 'depot_gui.c')
-rw-r--r-- | depot_gui.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/depot_gui.c b/depot_gui.c index d83e9119e..494efa992 100644 --- a/depot_gui.c +++ b/depot_gui.c @@ -4,6 +4,7 @@ #include "openttd.h" #include "functions.h" #include "ship.h" +#include "aircraft.h" #include "table/strings.h" #include "table/sprites.h" #include "gui.h" @@ -150,7 +151,12 @@ extern int WagonLengthToPixels(int len); void CcCloneVehicle(bool success, TileIndex tile, uint32 p1, uint32 p2) { if (!success) return; - CcCloneShip(true, tile, p1, p2); + switch(GetVehicle(p1)->type) { + case VEH_Train: CcCloneTrain( true, tile, p1, p2); break; + case VEH_Road: CcCloneRoadVeh( true, tile, p1, p2); break; + case VEH_Ship: CcCloneShip( true, tile, p1, p2); break; + case VEH_Aircraft: CcCloneAircraft(true, tile, p1, p2); break; + } } static inline void ShowVehicleViewWindow(const Vehicle *v) |