Codechange: Pass unpacked command arguments to command callbacks (except Script).
This commit is contained in:
@@ -89,7 +89,7 @@ static bool IsStationAvailable(const StationSpec *statspec)
|
||||
return Convert8bitBooleanCallback(statspec->grf_prop.grffile, CBID_STATION_AVAILABILITY, cb_res);
|
||||
}
|
||||
|
||||
void CcPlaySound_CONSTRUCTION_RAIL(Commands cmd, const CommandCost &result,TileIndex tile, const CommandDataBuffer &)
|
||||
void CcPlaySound_CONSTRUCTION_RAIL(Commands cmd, const CommandCost &result, TileIndex tile)
|
||||
{
|
||||
if (result.Succeeded() && _settings_client.sound.confirm) SndPlayTileFx(SND_20_CONSTRUCTION_RAIL, tile);
|
||||
}
|
||||
@@ -135,12 +135,10 @@ static const DiagDirection _place_depot_extra_dir[12] = {
|
||||
DIAGDIR_NW, DIAGDIR_NE, DIAGDIR_NW, DIAGDIR_NE,
|
||||
};
|
||||
|
||||
void CcRailDepot(Commands cmd, const CommandCost &result, TileIndex tile, const CommandDataBuffer &data)
|
||||
void CcRailDepot(Commands cmd, const CommandCost &result, TileIndex tile, RailType rt, DiagDirection dir)
|
||||
{
|
||||
if (result.Failed()) return;
|
||||
|
||||
auto [tile_, rt, dir] = EndianBufferReader::ToValue<CommandTraits<CMD_BUILD_TRAIN_DEPOT>::Args>(data);
|
||||
|
||||
if (_settings_client.sound.confirm) SndPlayTileFx(SND_20_CONSTRUCTION_RAIL, tile);
|
||||
if (!_settings_client.gui.persistent_buildingtools) ResetObjectToPlace();
|
||||
|
||||
@@ -176,7 +174,7 @@ static void PlaceRail_Waypoint(TileIndex tile)
|
||||
}
|
||||
}
|
||||
|
||||
void CcStation(Commands cmd, const CommandCost &result, TileIndex tile, const CommandDataBuffer &)
|
||||
void CcStation(Commands cmd, const CommandCost &result, TileIndex tile)
|
||||
{
|
||||
if (result.Failed()) return;
|
||||
|
||||
@@ -275,7 +273,7 @@ static void PlaceRail_Bridge(TileIndex tile, Window *w)
|
||||
}
|
||||
|
||||
/** Command callback for building a tunnel */
|
||||
void CcBuildRailTunnel(Commands cmd, const CommandCost &result,TileIndex tile, const CommandDataBuffer &)
|
||||
void CcBuildRailTunnel(Commands cmd, const CommandCost &result, TileIndex tile)
|
||||
{
|
||||
if (result.Succeeded()) {
|
||||
if (_settings_client.sound.confirm) SndPlayTileFx(SND_20_CONSTRUCTION_RAIL, tile);
|
||||
|
Reference in New Issue
Block a user