Fix DamageOtherOnHit.OnDoHit when the target is terminating or deleted (#28690)
This commit is contained in:
@@ -31,6 +31,8 @@ namespace Content.Server.Damage.Systems
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void OnDoHit(EntityUid uid, DamageOtherOnHitComponent component, ThrowDoHitEvent args)
|
private void OnDoHit(EntityUid uid, DamageOtherOnHitComponent component, ThrowDoHitEvent args)
|
||||||
|
{
|
||||||
|
if (!TerminatingOrDeleted(args.Target))
|
||||||
{
|
{
|
||||||
var dmg = _damageable.TryChangeDamage(args.Target, component.Damage, component.IgnoreResistances, origin: args.Component.Thrower);
|
var dmg = _damageable.TryChangeDamage(args.Target, component.Damage, component.IgnoreResistances, origin: args.Component.Thrower);
|
||||||
|
|
||||||
@@ -49,6 +51,7 @@ namespace Content.Server.Damage.Systems
|
|||||||
var direction = body.LinearVelocity.Normalized();
|
var direction = body.LinearVelocity.Normalized();
|
||||||
_sharedCameraRecoil.KickCamera(args.Target, direction);
|
_sharedCameraRecoil.KickCamera(args.Target, direction);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: If more stuff touches this then handle it after.
|
// TODO: If more stuff touches this then handle it after.
|
||||||
if (TryComp<PhysicsComponent>(uid, out var physics))
|
if (TryComp<PhysicsComponent>(uid, out var physics))
|
||||||
|
|||||||
Reference in New Issue
Block a user