From 3d362f251337a248b020dc32d374bbaa94f6d7a3 Mon Sep 17 00:00:00 2001 From: Samu Date: Sun, 3 Nov 2019 20:13:06 +0000 Subject: Fix #7697: Add a Missing AddProducedCargo proc for HQ On TileLoop_Object, HQs are able to produce and move passengers and mail to stations, but querying the HQ tiles for cargo supplied was returning nothing. This makes it so that they return +1 to both passengers and mail. --- src/object_cmd.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/object_cmd.cpp b/src/object_cmd.cpp index 48b6f1f25..adf656f7f 100644 --- a/src/object_cmd.cpp +++ b/src/object_cmd.cpp @@ -559,6 +559,14 @@ static void AddAcceptedCargo_Object(TileIndex tile, CargoArray &acceptance, Carg SetBit(*always_accepted, CT_MAIL); } +static void AddProducedCargo_Object(TileIndex tile, CargoArray &produced) +{ + if (!IsObjectType(tile, OBJECT_HQ)) return; + + produced[CT_PASSENGERS]++; + produced[CT_MAIL]++; +} + static void GetTileDesc_Object(TileIndex tile, TileDesc *td) { @@ -840,7 +848,7 @@ extern const TileTypeProcs _tile_type_object_procs = { AnimateTile_Object, // animate_tile_proc TileLoop_Object, // tile_loop_proc ChangeTileOwner_Object, // change_tile_owner_proc - nullptr, // add_produced_cargo_proc + AddProducedCargo_Object, // add_produced_cargo_proc nullptr, // vehicle_enter_tile_proc GetFoundation_Object, // get_foundation_proc TerraformTile_Object, // terraform_tile_proc -- cgit v1.2.3-70-g09d2