Fire MeleeHitEvent on misses. (#12867)

* Fire MeleeHitEvent when there are no targets.

* Prevent certain weapons from activating if they had no hit entities on hit.

* Prevent miss events from firing when target is yourself or was deleted.

* Use .Value as Target is already known not to be null.

* uid changes

---------

Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
Vordenburg
2023-02-13 07:55:39 -05:00
committed by GitHub
parent 650ade0d4e
commit 4183b5f449
8 changed files with 95 additions and 82 deletions

View File

@@ -127,7 +127,7 @@ public sealed partial class NPCSteeringSystem
// TODO: Validate we can damage it
if (destructibleQuery.HasComponent(ent))
{
_melee.AttemptLightAttack(component.Owner, meleeWeapon, ent);
_melee.AttemptLightAttack(component.Owner, component.Owner, meleeWeapon, ent);
break;
}
}