mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-04 06:00:15 +00:00
(svn r11608) -Fix: do not trigger industries, but only the industry's tiles.
This commit is contained in:
parent
eff1c37b77
commit
aa39d2a618
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user