summaryrefslogtreecommitdiff
path: root/src/tile_cmd.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/tile_cmd.h')
-rw-r--r--src/tile_cmd.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/tile_cmd.h b/src/tile_cmd.h
index a1cd92fda..6d8cb1a40 100644
--- a/src/tile_cmd.h
+++ b/src/tile_cmd.h
@@ -103,7 +103,7 @@ typedef TrackStatus GetTileTrackStatusProc(TileIndex tile, TransportType mode, u
* @param tile Tile being queried
* @param b Destination array of produced cargo
*/
-typedef void GetProducedCargoProc(TileIndex tile, CargoID *b);
+typedef void AddProducedCargoProc(TileIndex tile, AcceptedCargo ac);
typedef bool ClickTileProc(TileIndex tile);
typedef void AnimateTileProc(TileIndex tile);
typedef void TileLoopProc(TileIndex tile);
@@ -144,7 +144,7 @@ struct TileTypeProcs {
AnimateTileProc *animate_tile_proc;
TileLoopProc *tile_loop_proc;
ChangeTileOwnerProc *change_tile_owner_proc;
- GetProducedCargoProc *get_produced_cargo_proc; ///< Return produced cargo of the tile
+ AddProducedCargoProc *add_produced_cargo_proc; ///< Adds produced cargo of the tile to cargo array supplied as parameter
VehicleEnterTileProc *vehicle_enter_tile_proc; ///< Called when a vehicle enters a tile
GetFoundationProc *get_foundation_proc;
TerraformTileProc *terraform_tile_proc; ///< Called when a terraforming operation is about to take place
@@ -164,6 +164,13 @@ static inline void AddAcceptedCargo(TileIndex tile, AcceptedCargo ac)
proc(tile, ac);
}
+static inline void AddProducedCargo(TileIndex tile, AcceptedCargo ac)
+{
+ AddProducedCargoProc *proc = _tile_type_procs[GetTileType(tile)]->add_produced_cargo_proc;
+ if (proc == NULL) return;
+ proc(tile, ac);
+}
+
static inline void AnimateTile(TileIndex tile)
{
AnimateTileProc *proc = _tile_type_procs[GetTileType(tile)]->animate_tile_proc;