Initialize ABM timer to random value to spread processing
parent
4630281318
commit
6286c555d4
|
@ -203,6 +203,19 @@ u32 Environment::getDayNightRatio()
|
||||||
return time_to_daynight_ratio(m_time_of_day);
|
return time_to_daynight_ratio(m_time_of_day);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
ABMWithState
|
||||||
|
*/
|
||||||
|
|
||||||
|
ABMWithState::ABMWithState(ActiveBlockModifier *abm_):
|
||||||
|
abm(abm_),
|
||||||
|
timer(0)
|
||||||
|
{
|
||||||
|
// Initialize timer to random value to spread processing
|
||||||
|
float itv = abm->getTriggerInterval();
|
||||||
|
timer = myrand_range(-0.51*itv, 0.51*itv);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
ActiveBlockList
|
ActiveBlockList
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -129,10 +129,7 @@ struct ABMWithState
|
||||||
ActiveBlockModifier *abm;
|
ActiveBlockModifier *abm;
|
||||||
float timer;
|
float timer;
|
||||||
|
|
||||||
ABMWithState(ActiveBlockModifier *abm_):
|
ABMWithState(ActiveBlockModifier *abm_);
|
||||||
abm(abm_),
|
|
||||||
timer(0)
|
|
||||||
{}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue