Clean up all missing EntitySystem proxy method uses (#38353)
This commit is contained in:
@@ -68,7 +68,7 @@ public sealed class ThrusterSystem : EntitySystem
|
||||
args.PushMarkup(enabled);
|
||||
|
||||
if (component.Type == ThrusterType.Linear &&
|
||||
EntityManager.TryGetComponent(uid, out TransformComponent? xform) &&
|
||||
TryComp(uid, out TransformComponent? xform) &&
|
||||
xform.Anchored)
|
||||
{
|
||||
var nozzleLocalization = ContentLocalizationManager.FormatDirection(xform.LocalRotation.Opposite().ToWorldVec().GetDir()).ToLower();
|
||||
@@ -163,8 +163,8 @@ public sealed class ThrusterSystem : EntitySystem
|
||||
// TODO: Don't make them rotatable and make it require anchoring.
|
||||
|
||||
if (!component.Enabled ||
|
||||
!EntityManager.TryGetComponent(uid, out TransformComponent? xform) ||
|
||||
!EntityManager.TryGetComponent(xform.GridUid, out ShuttleComponent? shuttleComponent))
|
||||
!TryComp(uid, out TransformComponent? xform) ||
|
||||
!TryComp(xform.GridUid, out ShuttleComponent? shuttleComponent))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -285,7 +285,7 @@ public sealed class ThrusterSystem : EntitySystem
|
||||
|
||||
component.IsOn = true;
|
||||
|
||||
if (!EntityManager.TryGetComponent(xform.GridUid, out ShuttleComponent? shuttleComponent))
|
||||
if (!TryComp(xform.GridUid, out ShuttleComponent? shuttleComponent))
|
||||
return;
|
||||
|
||||
// Logger.DebugS("thruster", $"Enabled thruster {uid}");
|
||||
@@ -300,7 +300,7 @@ public sealed class ThrusterSystem : EntitySystem
|
||||
shuttleComponent.LinearThrusters[direction].Add(uid);
|
||||
|
||||
// Don't just add / remove the fixture whenever the thruster fires because perf
|
||||
if (EntityManager.TryGetComponent(uid, out PhysicsComponent? physicsComponent) &&
|
||||
if (TryComp(uid, out PhysicsComponent? physicsComponent) &&
|
||||
component.BurnPoly.Count > 0)
|
||||
{
|
||||
var shape = new PolygonShape();
|
||||
@@ -318,7 +318,7 @@ public sealed class ThrusterSystem : EntitySystem
|
||||
throw new ArgumentOutOfRangeException();
|
||||
}
|
||||
|
||||
if (EntityManager.TryGetComponent(uid, out AppearanceComponent? appearance))
|
||||
if (TryComp(uid, out AppearanceComponent? appearance))
|
||||
{
|
||||
_appearance.SetData(uid, ThrusterVisualState.State, true, appearance);
|
||||
}
|
||||
@@ -382,7 +382,7 @@ public sealed class ThrusterSystem : EntitySystem
|
||||
|
||||
component.IsOn = false;
|
||||
|
||||
if (!EntityManager.TryGetComponent(gridId, out ShuttleComponent? shuttleComponent))
|
||||
if (!TryComp(gridId, out ShuttleComponent? shuttleComponent))
|
||||
return;
|
||||
|
||||
// Logger.DebugS("thruster", $"Disabled thruster {uid}");
|
||||
@@ -406,7 +406,7 @@ public sealed class ThrusterSystem : EntitySystem
|
||||
throw new ArgumentOutOfRangeException();
|
||||
}
|
||||
|
||||
if (EntityManager.TryGetComponent(uid, out AppearanceComponent? appearance))
|
||||
if (TryComp(uid, out AppearanceComponent? appearance))
|
||||
{
|
||||
_appearance.SetData(uid, ThrusterVisualState.State, false, appearance);
|
||||
}
|
||||
@@ -418,7 +418,7 @@ public sealed class ThrusterSystem : EntitySystem
|
||||
|
||||
_ambient.SetAmbience(uid, false);
|
||||
|
||||
if (EntityManager.TryGetComponent(uid, out PhysicsComponent? physicsComponent))
|
||||
if (TryComp(uid, out PhysicsComponent? physicsComponent))
|
||||
{
|
||||
_fixtureSystem.DestroyFixture(uid, BurnFixture, body: physicsComponent);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user