diff options
author | rubidium <rubidium@openttd.org> | 2007-08-26 21:21:59 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-08-26 21:21:59 +0000 |
commit | 3c919e36a7408b681f9ff7b4a1e5fe6a4d75fe1e (patch) | |
tree | 285ea97aaef2e294fbb6fc9955cd0062ce164eb3 /src/depot_gui.cpp | |
parent | a5b32d8d7238ae769a9dc3bcc71aaaba213058b9 (diff) | |
download | openttd-3c919e36a7408b681f9ff7b4a1e5fe6a4d75fe1e.tar.xz |
(svn r10985) -Codechange: unify/remove duplicate CcClone(Aircraft|RoadVeh|Ship|Train) in favour of CcCloneVehicle.
Diffstat (limited to 'src/depot_gui.cpp')
-rw-r--r-- | src/depot_gui.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/depot_gui.cpp b/src/depot_gui.cpp index fda51d5a8..dc90e50de 100644 --- a/src/depot_gui.cpp +++ b/src/depot_gui.cpp @@ -130,14 +130,24 @@ static const WindowDesc _aircraft_depot_desc = { extern int WagonLengthToPixels(int len); +/** + * This is the Callback method after the cloning attempt of a vehicle + * @param success indicates completion (or not) of the operation + * @param tile unused + * @param p1 unused + * @param p2 unused + */ void CcCloneVehicle(bool success, TileIndex tile, uint32 p1, uint32 p2) { if (!success) return; + + Vehicle *v = GetVehicle(_new_vehicle_id); + 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; + case VEH_TRAIN: ShowTrainViewWindow(v); break; + case VEH_ROAD: ShowRoadVehViewWindow(v); break; + case VEH_SHIP: ShowShipViewWindow(v); break; + case VEH_AIRCRAFT: ShowAircraftViewWindow(v); break; default: NOT_REACHED(); } } |