[3 lines] fix damage origin (#12195)

This commit is contained in:
Rane
2022-10-30 03:39:38 -04:00
committed by GitHub
parent 9e4315d533
commit 9e917d44fe
2 changed files with 3 additions and 3 deletions

View File

@@ -161,7 +161,7 @@ public sealed class MeleeWeaponSystem : SharedMeleeWeaponSystem
RaiseLocalEvent(ev.Target.Value, new AttackedEvent(component.Owner, user, targetXform.Coordinates)); RaiseLocalEvent(ev.Target.Value, new AttackedEvent(component.Owner, user, targetXform.Coordinates));
var modifiedDamage = DamageSpecifier.ApplyModifierSets(damage + hitEvent.BonusDamage + itemDamage.BonusDamage, hitEvent.ModifiersList); var modifiedDamage = DamageSpecifier.ApplyModifierSets(damage + hitEvent.BonusDamage + itemDamage.BonusDamage, hitEvent.ModifiersList);
var damageResult = _damageable.TryChangeDamage(ev.Target, modifiedDamage); var damageResult = _damageable.TryChangeDamage(ev.Target, modifiedDamage, origin:user);
if (damageResult != null && damageResult.Total > FixedPoint2.Zero) if (damageResult != null && damageResult.Total > FixedPoint2.Zero)
{ {
@@ -277,7 +277,7 @@ public sealed class MeleeWeaponSystem : SharedMeleeWeaponSystem
{ {
RaiseLocalEvent(entity, new AttackedEvent(component.Owner, user, ev.Coordinates)); RaiseLocalEvent(entity, new AttackedEvent(component.Owner, user, ev.Coordinates));
var damageResult = _damageable.TryChangeDamage(entity, modifiedDamage); var damageResult = _damageable.TryChangeDamage(entity, modifiedDamage, origin:user);
if (damageResult != null && damageResult.Total > FixedPoint2.Zero) if (damageResult != null && damageResult.Total > FixedPoint2.Zero)
{ {

View File

@@ -189,7 +189,7 @@ namespace Content.Shared.Damage
if (!delta.Empty) if (!delta.Empty)
{ {
DamageChanged(damageable, delta, interruptsDoAfters); DamageChanged(damageable, delta, interruptsDoAfters, origin);
} }
return delta; return delta;