[3 lines] fix damage origin (#12195)
This commit is contained in:
@@ -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)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user