Inline OwnerUid

This commit is contained in:
Vera Aguilera Puerto
2021-12-03 16:30:34 +01:00
parent 2eacf98335
commit f386b57148
85 changed files with 219 additions and 215 deletions

View File

@@ -95,7 +95,7 @@ namespace Content.Shared.Damage
damage.DamageDict.Add(typeID, damageValue);
}
var actual = EntitySystem.Get<DamageableSystem>().TryChangeDamage(OwnerUid, damage);
var actual = EntitySystem.Get<DamageableSystem>().TryChangeDamage(((IComponent) this).Owner, damage);
// should logging be disabled during rad storms? a lot of entities are going to be damaged.
if (actual != null && !actual.Empty)
@@ -120,7 +120,7 @@ namespace Content.Shared.Damage
damage.DamageDict.Add(typeID, damageValue);
}
var actual = EntitySystem.Get<DamageableSystem>().TryChangeDamage(OwnerUid, damage);
var actual = EntitySystem.Get<DamageableSystem>().TryChangeDamage(((IComponent) this).Owner, damage);
// will logging handle nukes?
if (actual != null && !actual.Empty)

View File

@@ -128,9 +128,9 @@ namespace Content.Shared.Damage
SetTotalDamage(component, component.Damage.Total, logChange);
component.Dirty();
if (EntityManager.TryGetComponent<AppearanceComponent>(component.OwnerUid, out var appearance) && damageDelta != null)
if (EntityManager.TryGetComponent<AppearanceComponent>(((IComponent) component).Owner, out var appearance) && damageDelta != null)
appearance.SetData(DamageVisualizerKeys.DamageUpdateGroups, damageDelta.GetDamagePerGroup().Keys.ToList());
RaiseLocalEvent(component.OwnerUid, new DamageChangedEvent(component, damageDelta, interruptsDoAfters), false);
RaiseLocalEvent(((IComponent) component).Owner, new DamageChangedEvent(component, damageDelta, interruptsDoAfters), false);
}
/// <summary>