diff options
author | Michael Lutz <michi@icosahedron.de> | 2021-11-28 22:43:38 +0100 |
---|---|---|
committer | Michael Lutz <michi@icosahedron.de> | 2021-12-16 22:28:32 +0100 |
commit | 850385465543a9bd589084ec2ac6b0693c481fea (patch) | |
tree | fa0d375d36e946caee2c4ebc6a8ecd4e35f33d5b /src/group_gui.cpp | |
parent | d85348b1d1b9aa7099255eda7c1058f9749d1003 (diff) | |
download | openttd-850385465543a9bd589084ec2ac6b0693c481fea.tar.xz |
Codechange: Pass unpacked command arguments to command callbacks (except Script).
Diffstat (limited to 'src/group_gui.cpp')
-rw-r--r-- | src/group_gui.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/group_gui.cpp b/src/group_gui.cpp index 3175909f0..f614551f7 100644 --- a/src/group_gui.cpp +++ b/src/group_gui.cpp @@ -1153,17 +1153,15 @@ static void CcCreateGroup(VehicleType veh_type) * Opens a 'Rename group' window for newly created group. * @param cmd Unused. * @param result Did command succeed? - * @param tile Unused. - * @param data Command data. + * @param vt Vehicle type. + * @param parent_group Parent group of the enw group. * @see CmdCreateGroup */ -void CcCreateGroup(Commands cmd, const CommandCost &result, TileIndex tile, const CommandDataBuffer &data) +void CcCreateGroup(Commands cmd, const CommandCost &result, VehicleType vt, GroupID parent_group) { if (result.Failed()) return; - auto [vt, parent_group] = EndianBufferReader::ToValue<CommandTraits<CMD_CREATE_GROUP>::Args>(data); assert(vt <= VEH_AIRCRAFT); - CcCreateGroup(vt); } @@ -1171,16 +1169,13 @@ void CcCreateGroup(Commands cmd, const CommandCost &result, TileIndex tile, cons * Open rename window after adding a vehicle to a new group via drag and drop. * @param cmd Unused. * @param result Did command succeed? - * @param tile Unused. - * @param data Command data. + * @param veh_id vehicle to add to a group */ -void CcAddVehicleNewGroup(Commands cmd, const CommandCost &result, TileIndex tile, const CommandDataBuffer &data) +void CcAddVehicleNewGroup(Commands cmd, const CommandCost &result, GroupID, VehicleID veh_id, bool) { if (result.Failed()) return; - auto [group_id, veh_id, shared] = EndianBufferReader::ToValue<CommandTraits<CMD_ADD_VEHICLE_GROUP>::Args>(data); assert(Vehicle::IsValidID(veh_id)); - CcCreateGroup(Vehicle::Get(veh_id)->type); } |