Implements ChoiceQueue::move_pokemon_choice_next, micro optimization for BattleRandom::EffectChance.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user