Fix ABM handling on block activation
parent
07a5e59ae7
commit
8ed74a3429
|
@ -633,13 +633,15 @@ public:
|
||||||
i->timer -= trigger_interval;
|
i->timer -= trigger_interval;
|
||||||
actual_interval = trigger_interval;
|
actual_interval = trigger_interval;
|
||||||
}
|
}
|
||||||
ActiveABM aabm;
|
|
||||||
aabm.abm = abm;
|
|
||||||
float intervals = actual_interval / trigger_interval;
|
float intervals = actual_interval / trigger_interval;
|
||||||
|
if(intervals == 0)
|
||||||
|
continue;
|
||||||
float chance = abm->getTriggerChance();
|
float chance = abm->getTriggerChance();
|
||||||
if(chance == 0)
|
if(chance == 0)
|
||||||
chance = 1;
|
chance = 1;
|
||||||
aabm.chance = 1.0 / pow((float)1.0/chance, (float)intervals);
|
ActiveABM aabm;
|
||||||
|
aabm.abm = abm;
|
||||||
|
aabm.chance = chance / intervals;
|
||||||
if(aabm.chance == 0)
|
if(aabm.chance == 0)
|
||||||
aabm.chance = 1;
|
aabm.chance = 1;
|
||||||
// Trigger neighbors
|
// Trigger neighbors
|
||||||
|
|
Loading…
Reference in New Issue