Merge branch 'crabman/precision-fix' into 'master'

Don't use attacker orientation for calculating melee precision

See merge request veloren/veloren!4191
This commit is contained in:
Samuel Keiffer 2023-11-23 00:33:51 +00:00
commit b1a7c71f23

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 {