Implements ChoiceQueue::move_pokemon_choice_next, micro optimization for BattleRandom::EffectChance.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2022-08-28 15:34:40 +02:00
parent ba5992e925
commit 4c06dc17e2
2 changed files with 39 additions and 3 deletions

View File

@@ -67,7 +67,15 @@ impl BattleRandom {
hit_number,
&mut chance
);
self.get_rng().lock().unwrap().get_float() < (chance / 100.0)
if chance < 100.0 {
if chance > 0.0 {
self.get_rng().lock().unwrap().get_float() < (chance / 100.0)
} else {
false
}
} else {
true
}
}
}