adds a source uid to most damage & mobstate events (#11559)

Co-authored-by: Flipp Syder <76629141+vulppine@users.noreply.github.com>
This commit is contained in:
Paul Ritter
2022-10-08 12:15:27 +02:00
committed by GitHub
parent 548cee77e2
commit 79854e59a4
24 changed files with 50 additions and 37 deletions

View File

@@ -105,7 +105,7 @@ namespace Content.Server.Electrocution
_prototypeManager.Index<DamageTypePrototype>(DamageType),
(int) finished.AccumulatedDamage);
var actual = _damageableSystem.TryChangeDamage(finished.Electrocuting, damage);
var actual = _damageableSystem.TryChangeDamage(finished.Electrocuting, damage, origin: finished.Source);
if (actual != null)
{
_adminLogger.Add(LogType.Electrocution,
@@ -315,6 +315,7 @@ namespace Content.Server.Electrocution
electrocutionComponent.TimeLeft = 1f;
electrocutionComponent.Electrocuting = uid;
electrocutionComponent.Source = sourceUid;
RaiseLocalEvent(uid, new ElectrocutedEvent(uid, sourceUid, siemensCoefficient), true);
@@ -369,7 +370,7 @@ namespace Content.Server.Electrocution
if(shockDamage is {} dmg)
{
var actual = _damageableSystem.TryChangeDamage(uid,
new DamageSpecifier(_prototypeManager.Index<DamageTypePrototype>(DamageType), dmg));
new DamageSpecifier(_prototypeManager.Index<DamageTypePrototype>(DamageType), dmg), origin: sourceUid);
if (actual != null)
{