summaryrefslogtreecommitdiff
path: root/src/tile_cmd.h
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-09-07 07:39:08 +0000
committersmatz <smatz@openttd.org>2009-09-07 07:39:08 +0000
commit22e9d595591dab19e9d37a42f8d529570f582847 (patch)
tree066e3cee3770b84cb97671dd3bffa78f7df61882 /src/tile_cmd.h
parent9168ddd5507026b6346797f48bd0853091cbcb4e (diff)
downloadopenttd-22e9d595591dab19e9d37a42f8d529570f582847.tar.xz
(svn r17439) -Fix (r17436): you weren't paid for cargo delivered to houses and headquarters anymore
Diffstat (limited to 'src/tile_cmd.h')
-rw-r--r--src/tile_cmd.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/tile_cmd.h b/src/tile_cmd.h
index 05f76cc62..593c0500f 100644
--- a/src/tile_cmd.h
+++ b/src/tile_cmd.h
@@ -78,10 +78,11 @@ typedef CommandCost ClearTileProc(TileIndex tile, DoCommandFlag flags);
/**
* Tile callback function signature for obtaining cargo acceptance of a tile
- * @param tile Tile queried for its accepted cargo
- * @param acceptance Storage destination of the cargo acceptance in 1/8
+ * @param tile Tile queried for its accepted cargo
+ * @param acceptance Storage destination of the cargo acceptance in 1/8
+ * @param town_acc Bitmask of town and headquarters-accepted cargo
*/
-typedef void AddAcceptedCargoProc(TileIndex tile, CargoArray &acceptance);
+typedef void AddAcceptedCargoProc(TileIndex tile, CargoArray &acceptance, uint32 *town_acc);
/**
* Tile callback function signature for obtaining a tile description
@@ -164,11 +165,12 @@ VehicleEnterTileStatus VehicleEnterTile(Vehicle *v, TileIndex tile, int x, int y
void ChangeTileOwner(TileIndex tile, Owner old_owner, Owner new_owner);
void GetTileDesc(TileIndex tile, TileDesc *td);
-static inline void AddAcceptedCargo(TileIndex tile, CargoArray &acceptance)
+static inline void AddAcceptedCargo(TileIndex tile, CargoArray &acceptance, uint32 *town_acc)
{
AddAcceptedCargoProc *proc = _tile_type_procs[GetTileType(tile)]->add_accepted_cargo_proc;
if (proc == NULL) return;
- proc(tile, acceptance);
+ uint32 dummy = 0; // use dummy bitmask so there don't need to be several 'town_acc != NULL' checks
+ proc(tile, acceptance, town_acc == NULL ? &dummy : town_acc);
}
static inline void AddProducedCargo(TileIndex tile, CargoArray &produced)