Inline OwnerUid
This commit is contained in:
@@ -57,7 +57,7 @@ public class LungSystem : EntitySystem
|
||||
if (!Resolve(uid, ref lung, ref mech))
|
||||
return;
|
||||
|
||||
if (mech.Body != null && EntityManager.TryGetComponent(mech.Body.OwnerUid, out MobStateComponent? mobState) && mobState.IsCritical())
|
||||
if (mech.Body != null && EntityManager.TryGetComponent(((IComponent) mech.Body).Owner, out MobStateComponent? mobState) && mobState.IsCritical())
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -111,7 +111,7 @@ public class LungSystem : EntitySystem
|
||||
|
||||
// TODO Jesus Christ make this event based.
|
||||
if (mech.Body != null &&
|
||||
EntityManager.TryGetComponent(mech.Body.OwnerUid, out InternalsComponent? internals) &&
|
||||
EntityManager.TryGetComponent(((IComponent) mech.Body).Owner, out InternalsComponent? internals) &&
|
||||
internals.BreathToolEntity != null &&
|
||||
internals.GasTankEntity != null &&
|
||||
IoCManager.Resolve<IEntityManager>().TryGetComponent(internals.BreathToolEntity, out BreathToolComponent? breathTool) &&
|
||||
@@ -148,7 +148,7 @@ public class LungSystem : EntitySystem
|
||||
if (mech.Body == null)
|
||||
return;
|
||||
|
||||
if (!EntityManager.TryGetComponent(mech.Body.OwnerUid, out BloodstreamComponent? bloodstream))
|
||||
if (!EntityManager.TryGetComponent(((IComponent) mech.Body).Owner, out BloodstreamComponent? bloodstream))
|
||||
return;
|
||||
|
||||
var to = bloodstream.Air;
|
||||
@@ -189,10 +189,10 @@ public class LungSystem : EntitySystem
|
||||
if (mech.Body == null)
|
||||
return;
|
||||
|
||||
if (!EntityManager.TryGetComponent(mech.Body.OwnerUid, out BloodstreamComponent? bloodstream))
|
||||
if (!EntityManager.TryGetComponent(((IComponent) mech.Body).Owner, out BloodstreamComponent? bloodstream))
|
||||
return;
|
||||
|
||||
_bloodstreamSystem.PumpToxins(mech.Body.OwnerUid, lung.Air, bloodstream);
|
||||
_bloodstreamSystem.PumpToxins(((IComponent) mech.Body).Owner, lung.Air, bloodstream);
|
||||
|
||||
var lungRemoved = lung.Air.RemoveRatio(0.5f);
|
||||
_atmosSys.Merge(to, lungRemoved);
|
||||
|
||||
Reference in New Issue
Block a user