summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSamu <dj_samu@hotmail.com>2019-11-03 20:13:06 +0000
committerCharles Pigott <charlespigott@googlemail.com>2019-11-10 17:58:02 +0000
commit3d362f251337a248b020dc32d374bbaa94f6d7a3 (patch)
tree5560a70a2e46480b655db0f8cea367beeee533de /src
parent2be619ea88837c6293129841511816c105b507a3 (diff)
downloadopenttd-3d362f251337a248b020dc32d374bbaa94f6d7a3.tar.xz
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.
Diffstat (limited to 'src')
-rw-r--r--src/object_cmd.cpp10
1 files changed, 9 insertions, 1 deletions
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