Use nearest edge for interaction range (#11660)

Co-authored-by: metalgearsloth <metalgearsloth@gmail.com>
This commit is contained in:
metalgearsloth
2022-10-07 00:37:21 +11:00
committed by GitHub
parent 3b763192b0
commit c555203401
3 changed files with 88 additions and 18 deletions

View File

@@ -121,11 +121,8 @@ public sealed class MeleeWeaponSystem : SharedMeleeWeaponSystem
{
return;
}
// InRangeUnobstructed is insufficient rn as it checks the centre of the body rather than the nearest edge.
// TODO: Look at fixing it
// This is mainly to keep consistency between the wide attack raycast and the click attack raycast.
if (!_interaction.InRangeUnobstructed(user, ev.Target.Value, component.Range + 0.35f))
if (!_interaction.InRangeUnobstructed(user, ev.Target.Value, component.Range))
return;
var damage = component.Damage * GetModifier(component, true);