Changeset - r9028:43b29ac0a74d
[Not reviewed]
master
0 3 0
rubidium - 16 years ago 2008-04-23 00:14:49
rubidium@openttd.org
(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.
3 files changed with 7 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/industry_cmd.cpp
Show inline comments
 
@@ -1033,6 +1033,9 @@ static void ProduceIndustryGoods(Industr
 

	
 
			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;
 

	
 
	FOR_ALL_INDUSTRIES(i) {
 
		TriggerIndustry(i, INDUSTRY_TRIGGER_INDUSTRY_TICK);
 
		StartStopIndustryTileAnimation(i, IAT_INDUSTRY_TICK);
 
		ProduceIndustryGoods(i);
 
	}
 
}
src/newgrf_house.cpp
Show inline comments
 
@@ -547,6 +547,8 @@ static void DoTriggerHouse(TileIndex til
 
	HouseID hid = GetHouseType(tile);
 
	HouseSpec *hs = GetHouseSpecs(hid);
 

	
 
	if (hs->spritegroup == NULL) return;
 

	
 
	NewHouseResolver(&object, hid, tile, GetTownByTile(tile));
 

	
 
	object.callback = CBID_RANDOM_TRIGGER;
src/newgrf_industrytiles.cpp
Show inline comments
 
@@ -417,6 +417,8 @@ static void DoTriggerIndustryTile(TileIn
 
	IndustryGfx gfx = GetIndustryGfx(tile);
 
	const IndustryTileSpec *itspec = GetIndustryTileSpec(gfx);
 

	
 
	if (itspec->grf_prop.spritegroup == NULL) return;
 

	
 
	NewIndustryTileResolver(&object, gfx, tile, ind);
 

	
 
	object.callback = CBID_RANDOM_TRIGGER;
0 comments (0 inline, 0 general)