Changed how max precision was calculated to make it more compact.

This commit is contained in:
Sam 2023-11-14 18:16:42 -05:00
parent fb3d0208b9
commit 13148bd436
3 changed files with 15 additions and 13 deletions

View File

@ -249,11 +249,11 @@ impl<'a> System<'a> for Sys {
}
};
let precision_mult = precision_from_flank
.map(|flank| {
precision_from_time.map_or(flank, |head: f32| head.max(flank))
})
.or(precision_from_time);
let precision_mult = match (precision_from_flank, precision_from_time) {
(Some(a), Some(b)) => Some(a.max(b)),
(Some(a), None) | (None, Some(a)) => Some(a),
(None, None) => None,
};
let attack_options = AttackOptions {
target_dodging,

View File

@ -234,11 +234,11 @@ impl<'a> System<'a> for Sys {
}
};
let precision_mult = precision_from_flank
.map(|flank| {
precision_from_poise.map_or(flank, |head: f32| head.max(flank))
})
.or(precision_from_poise);
let precision_mult = match (precision_from_flank, precision_from_poise) {
(Some(a), Some(b)) => Some(a.max(b)),
(Some(a), None) | (None, Some(a)) => Some(a),
(None, None) => None,
};
let attack_options = AttackOptions {
target_dodging,

View File

@ -416,9 +416,11 @@ fn dispatch_hit(
}
};
let precision_mult = precision_from_flank
.map(|flank| precision_from_head.map_or(flank, |head: f32| head.max(flank)))
.or(precision_from_head);
let precision_mult = match (precision_from_flank, precision_from_head) {
(Some(a), Some(b)) => Some(a.max(b)),
(Some(a), None) | (None, Some(a)) => Some(a),
(None, None) => None,
};
let attack_options = AttackOptions {
target_dodging,