summaryrefslogtreecommitdiff
path: root/src/train_gui.cpp
diff options
context:
space:
mode:
authorMichael Lutz <michi@icosahedron.de>2021-11-30 23:21:16 +0100
committerMichael Lutz <michi@icosahedron.de>2021-12-16 22:28:32 +0100
commit41fa16f3254ffa9f44b85d6570a2293e8438b427 (patch)
treea508634b7dea7a0937e92c143db0a392cd99a4b0 /src/train_gui.cpp
parent57b82e2e99aa30a649d1fd80f192ccf5338dc7c4 (diff)
downloadopenttd-41fa16f3254ffa9f44b85d6570a2293e8438b427.tar.xz
Codechange: Don't use globals for return values from vehicle command procs.
Diffstat (limited to 'src/train_gui.cpp')
-rw-r--r--src/train_gui.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/train_gui.cpp b/src/train_gui.cpp
index d6c7320e6..f65b359df 100644
--- a/src/train_gui.cpp
+++ b/src/train_gui.cpp
@@ -24,9 +24,10 @@
* Callback for building wagons.
* @param cmd Unused.
* @param result The result of the command.
+ * @param new_veh_id ID of the ne vehicle.
* @param tile The tile the command was executed on.
*/
-void CcBuildWagon(Commands cmd, const CommandCost &result, TileIndex tile)
+void CcBuildWagon(Commands cmd, const CommandCost &result, VehicleID new_veh_id, uint, uint16, TileIndex tile, EngineID, bool, CargoID, ClientID)
{
if (result.Failed()) return;
@@ -43,7 +44,7 @@ void CcBuildWagon(Commands cmd, const CommandCost &result, TileIndex tile)
if (found != nullptr) {
found = found->Last();
/* put the new wagon at the end of the loco. */
- Command<CMD_MOVE_RAIL_VEHICLE>::Post( _new_vehicle_id, found->index, false);
+ Command<CMD_MOVE_RAIL_VEHICLE>::Post(new_veh_id, found->index, false);
InvalidateWindowClassesData(WC_TRAINS_LIST, 0);
}
}