(svn r11608) -Fix: do not trigger industries, but only the industry's tiles.

This commit is contained in:
rubidium 2007-12-09 18:27:40 +00:00
parent eff1c37b77
commit aa39d2a618
2 changed files with 0 additions and 20 deletions

View File

@ -535,19 +535,3 @@ void IndustryProductionCallback(Industry *ind, int reason)
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;
}

View File

@ -413,8 +413,6 @@ void TriggerIndustryTile(TileIndex tile, IndustryTileTrigger trigger)
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, IndustryTileTrigger trigger)
DoTriggerIndustryTile(tile, trigger, ind);
}
END_TILE_LOOP(tile, ind->width, ind->height, ind->xy)
DoTriggerIndustry(ind, trigger);
}