summaryrefslogtreecommitdiff
path: root/src/industry_cmd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-11-11 17:56:37 +0000
committerrubidium <rubidium@openttd.org>2007-11-11 17:56:37 +0000
commitaf5c2a785f11cc6c56813285fe0d1b09369b0acb (patch)
treef9e7187a01ac304ba4976cb42e34a137f6511115 /src/industry_cmd.cpp
parentf6dda295496e642a04f212e8aa41cdfdf74a347d (diff)
downloadopenttd-af5c2a785f11cc6c56813285fe0d1b09369b0acb.tar.xz
(svn r11410) -Codechange: implement random triggers for industries.
Diffstat (limited to 'src/industry_cmd.cpp')
-rw-r--r--src/industry_cmd.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp
index 1314fe2ec..6d08fde44 100644
--- a/src/industry_cmd.cpp
+++ b/src/industry_cmd.cpp
@@ -701,6 +701,8 @@ static void TileLoop_Industry(TileIndex tile)
IndustryGfx newgfx;
IndustryGfx gfx;
+ TriggerIndustryTile(tile, INDTILE_TRIGGER_TILE_LOOP);
+
if (!IsIndustryCompleted(tile)) {
MakeIndustryTileBigger(tile);
return;
@@ -1042,6 +1044,7 @@ void OnTick_Industry()
if (_game_mode == GM_EDITOR) return;
FOR_ALL_INDUSTRIES(i) {
+ TriggerIndustry(i, INDUSTRY_TRIGGER_INDUSTRY_TICK);
StartStopIndustryTileAnimation(i, IAT_INDUSTRY_TICK);
ProduceIndustryGoods(i);
}
@@ -2137,6 +2140,9 @@ static const SaveLoad _industry_desc[] = {
SLE_CONDARRX(cpp_offsetof(Industry, psa) + cpp_offsetof(Industry::PersistentStorage, storage), SLE_UINT32, 16, 76, SL_MAX_VERSION),
+ SLE_CONDVAR(Industry, random_triggers, SLE_UINT8, 82, SL_MAX_VERSION),
+ SLE_CONDVAR(Industry, random, SLE_UINT16, 82, SL_MAX_VERSION),
+
/* reserve extra space in savegame here. (currently 32 bytes) */
SLE_CONDNULL(32, 2, SL_MAX_VERSION),