mirror of https://github.com/OpenTTD/OpenTTD
(svn r11608) -Fix: do not trigger industries, but only the industry's tiles.
parent
f20e414e2e
commit
c3ea7e4dc4
|
@ -535,19 +535,3 @@ void IndustryProductionCallback(Industry *ind, int reason)
|
||||||
|
|
||||||
InvalidateWindow(WC_INDUSTRY_VIEW, ind->index);
|
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));
|
DoTriggerIndustryTile(tile, trigger, GetIndustryByTile(tile));
|
||||||
}
|
}
|
||||||
|
|
||||||
extern void DoTriggerIndustry(Industry *ind, IndustryTileTrigger trigger);
|
|
||||||
|
|
||||||
void TriggerIndustry(Industry *ind, IndustryTileTrigger trigger)
|
void TriggerIndustry(Industry *ind, IndustryTileTrigger trigger)
|
||||||
{
|
{
|
||||||
BEGIN_TILE_LOOP(tile, ind->width, ind->height, ind->xy)
|
BEGIN_TILE_LOOP(tile, ind->width, ind->height, ind->xy)
|
||||||
|
@ -422,6 +420,4 @@ void TriggerIndustry(Industry *ind, IndustryTileTrigger trigger)
|
||||||
DoTriggerIndustryTile(tile, trigger, ind);
|
DoTriggerIndustryTile(tile, trigger, ind);
|
||||||
}
|
}
|
||||||
END_TILE_LOOP(tile, ind->width, ind->height, ind->xy)
|
END_TILE_LOOP(tile, ind->width, ind->height, ind->xy)
|
||||||
|
|
||||||
DoTriggerIndustry(ind, trigger);
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue