Don't use attacker orientation for calculating melee precision

This commit is contained in:
maxicarlos08 2023-11-23 00:45:21 +01:00
parent 456c0ad3e8
commit 4456643867
No known key found for this signature in database

View File

@ -220,8 +220,12 @@ impl<'a> System<'a> for Sys {
target,
);
let precision_from_flank =
combat::precision_mult_from_flank(*ori.look_dir(), target_ori);
// Note: Don't use ori.look_vec() here, it leads to incorrect results for wide
// angle melee attacks
let precision_from_flank = combat::precision_mult_from_flank(
(pos_b.0 - pos.0).try_normalized().unwrap_or(ori.look_vec()),
target_ori,
);
let precision_from_poise = {
if let Some(CharacterState::Stunned(data)) = target_char_state {