mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Changed how max precision was calculated to make it more compact.
This commit is contained in:
parent
fb3d0208b9
commit
13148bd436
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user