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:
@@ -91,14 +91,14 @@ public sealed class MeleeWeaponSystem : SharedMeleeWeaponSystem
|
||||
return;
|
||||
|
||||
if (user == null)
|
||||
PopupSystem.PopupEntity(message, uid.Value);
|
||||
PopupSystem.PopupEntity(message, uid.Value);
|
||||
else
|
||||
PopupSystem.PopupEntity(message, uid.Value, Filter.PvsExcept(user.Value, entityManager: EntityManager), true);
|
||||
}
|
||||
|
||||
protected override bool DoDisarm(EntityUid user, DisarmAttackEvent ev, MeleeWeaponComponent component, ICommonSession? session)
|
||||
protected override bool DoDisarm(EntityUid user, DisarmAttackEvent ev, EntityUid meleeUid, MeleeWeaponComponent component, ICommonSession? session)
|
||||
{
|
||||
if (!base.DoDisarm(user, ev, component, session))
|
||||
if (!base.DoDisarm(user, ev, meleeUid, component, session))
|
||||
return false;
|
||||
|
||||
if (!TryComp<CombatModeComponent>(user, out var combatMode) ||
|
||||
@@ -228,11 +228,12 @@ public sealed class MeleeWeaponSystem : SharedMeleeWeaponSystem
|
||||
|
||||
private void OnChemicalInjectorHit(EntityUid owner, MeleeChemicalInjectorComponent comp, MeleeHitEvent args)
|
||||
{
|
||||
if (!args.IsHit)
|
||||
return;
|
||||
|
||||
if (!_solutions.TryGetSolution(owner, comp.Solution, out var solutionContainer))
|
||||
if (!args.IsHit ||
|
||||
!args.HitEntities.Any() ||
|
||||
!_solutions.TryGetSolution(owner, comp.Solution, out var solutionContainer))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var hitBloodstreams = new List<BloodstreamComponent>();
|
||||
var bloodQuery = GetEntityQuery<BloodstreamComponent>();
|
||||
|
||||
Reference in New Issue
Block a user