src/newgrf_industries.cpp
changeset 8048 ee1bbcc3801a
parent 7958 e42fa05eb045
child 8090 d1b76fcc33a3
equal deleted inserted replaced
8047:50d438fdf470 8048:ee1bbcc3801a
   533 		SB(object.callback_param2, 24, 8, again);
   533 		SB(object.callback_param2, 24, 8, again);
   534 	}
   534 	}
   535 
   535 
   536 	InvalidateWindow(WC_INDUSTRY_VIEW, ind->index);
   536 	InvalidateWindow(WC_INDUSTRY_VIEW, ind->index);
   537 }
   537 }
   538 
       
   539 void DoTriggerIndustry(Industry *ind, IndustryTileTrigger trigger)
       
   540 {
       
   541 	ResolverObject object;
       
   542 
       
   543 	NewIndustryResolver(&object, ind->xy, ind);
       
   544 	object.callback = CBID_RANDOM_TRIGGER;
       
   545 	object.trigger = trigger;
       
   546 
       
   547 	const SpriteGroup *group = Resolve(GetIndustrySpec(ind->type)->grf_prop.spritegroup, &object);
       
   548 	if (group == NULL) return;
       
   549 
       
   550 	byte new_random_bits = Random();
       
   551 	ind->random &= ~object.reseed;
       
   552 	ind->random |= new_random_bits & object.reseed;
       
   553 }