Changeset - r8048:4c39b4120e6b
[Not reviewed]
master
0 2 0
rubidium - 17 years ago 2007-12-09 18:27:40
rubidium@openttd.org
(svn r11608) -Fix: do not trigger industries, but only the industry's tiles.
2 files changed with 0 insertions and 20 deletions:
0 comments (0 inline, 0 general)
src/newgrf_industries.cpp
Show inline comments
 
@@ -535,19 +535,3 @@ void IndustryProductionCallback(Industry
 

	
 
	InvalidateWindow(WC_INDUSTRY_VIEW, ind->index);
 
}
 

	
 
void DoTriggerIndustry(Industry *ind, IndustryTileTrigger trigger)
 
{
 
	ResolverObject object;
 

	
 
	NewIndustryResolver(&object, ind->xy, ind);
 
	object.callback = CBID_RANDOM_TRIGGER;
 
	object.trigger = trigger;
 

	
 
	const SpriteGroup *group = Resolve(GetIndustrySpec(ind->type)->grf_prop.spritegroup, &object);
 
	if (group == NULL) return;
 

	
 
	byte new_random_bits = Random();
 
	ind->random &= ~object.reseed;
 
	ind->random |= new_random_bits & object.reseed;
 
}
src/newgrf_industrytiles.cpp
Show inline comments
 
@@ -413,8 +413,6 @@ void TriggerIndustryTile(TileIndex tile,
 
	DoTriggerIndustryTile(tile, trigger, GetIndustryByTile(tile));
 
}
 

	
 
extern void DoTriggerIndustry(Industry *ind, IndustryTileTrigger trigger);
 

	
 
void TriggerIndustry(Industry *ind, IndustryTileTrigger trigger)
 
{
 
	BEGIN_TILE_LOOP(tile, ind->width, ind->height, ind->xy)
 
@@ -422,6 +420,4 @@ void TriggerIndustry(Industry *ind, Indu
 
			DoTriggerIndustryTile(tile, trigger, ind);
 
		}
 
	END_TILE_LOOP(tile, ind->width, ind->height, ind->xy)
 

	
 
	DoTriggerIndustry(ind, trigger);
 
}
0 comments (0 inline, 0 general)