mirror of https://github.com/OpenTTD/OpenTTD
(svn r12844) -Fix: the industry tick trigger should only be triggered once every 256 ticks, not every tick... Also bail out of the triggers a little earlier if you know they are not going to happen anyway.
parent
501b89b8de
commit
2d860049a7
|
@ -1033,6 +1033,9 @@ static void ProduceIndustryGoods(Industry *i)
|
||||||
|
|
||||||
if (cut) ChopLumberMillTrees(i);
|
if (cut) ChopLumberMillTrees(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TriggerIndustry(i, INDUSTRY_TRIGGER_INDUSTRY_TICK);
|
||||||
|
StartStopIndustryTileAnimation(i, IAT_INDUSTRY_TICK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1054,8 +1057,6 @@ void OnTick_Industry()
|
||||||
if (_game_mode == GM_EDITOR) return;
|
if (_game_mode == GM_EDITOR) return;
|
||||||
|
|
||||||
FOR_ALL_INDUSTRIES(i) {
|
FOR_ALL_INDUSTRIES(i) {
|
||||||
TriggerIndustry(i, INDUSTRY_TRIGGER_INDUSTRY_TICK);
|
|
||||||
StartStopIndustryTileAnimation(i, IAT_INDUSTRY_TICK);
|
|
||||||
ProduceIndustryGoods(i);
|
ProduceIndustryGoods(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -547,6 +547,8 @@ static void DoTriggerHouse(TileIndex tile, HouseTrigger trigger, byte base_rando
|
||||||
HouseID hid = GetHouseType(tile);
|
HouseID hid = GetHouseType(tile);
|
||||||
HouseSpec *hs = GetHouseSpecs(hid);
|
HouseSpec *hs = GetHouseSpecs(hid);
|
||||||
|
|
||||||
|
if (hs->spritegroup == NULL) return;
|
||||||
|
|
||||||
NewHouseResolver(&object, hid, tile, GetTownByTile(tile));
|
NewHouseResolver(&object, hid, tile, GetTownByTile(tile));
|
||||||
|
|
||||||
object.callback = CBID_RANDOM_TRIGGER;
|
object.callback = CBID_RANDOM_TRIGGER;
|
||||||
|
|
|
@ -417,6 +417,8 @@ static void DoTriggerIndustryTile(TileIndex tile, IndustryTileTrigger trigger, I
|
||||||
IndustryGfx gfx = GetIndustryGfx(tile);
|
IndustryGfx gfx = GetIndustryGfx(tile);
|
||||||
const IndustryTileSpec *itspec = GetIndustryTileSpec(gfx);
|
const IndustryTileSpec *itspec = GetIndustryTileSpec(gfx);
|
||||||
|
|
||||||
|
if (itspec->grf_prop.spritegroup == NULL) return;
|
||||||
|
|
||||||
NewIndustryTileResolver(&object, gfx, tile, ind);
|
NewIndustryTileResolver(&object, gfx, tile, ind);
|
||||||
|
|
||||||
object.callback = CBID_RANDOM_TRIGGER;
|
object.callback = CBID_RANDOM_TRIGGER;
|
||||||
|
|
Loading…
Reference in New Issue