Remove component.Paused (#6285)

This commit is contained in:
metalgearsloth
2022-01-26 17:57:48 +11:00
committed by GitHub
parent b2229a951d
commit 3f7f3baa16
6 changed files with 15 additions and 9 deletions

View File

@@ -105,13 +105,15 @@ namespace Content.Server.AI.EntitySystems
for (var i = 0; i < npcs.Length; i++) for (var i = 0; i < npcs.Length; i++)
{ {
MetaDataComponent? metadata = null;
var index = (i + startIndex) % npcs.Length; var index = (i + startIndex) % npcs.Length;
var npc = npcs[index]; var npc = npcs[index];
if (npc.Deleted) if (Deleted(npc.Owner, metadata))
continue; continue;
if (npc.Paused) // Probably gets resolved in deleted for us already
if (Paused(npc.Owner, metadata))
continue; continue;
npc.Update(frameTime); npc.Update(frameTime);

View File

@@ -347,7 +347,7 @@ namespace Content.Server.Atmos.EntitySystems
{ {
var atmosphere = _currentRunAtmosphere[_currentRunAtmosphereIndex]; var atmosphere = _currentRunAtmosphere[_currentRunAtmosphereIndex];
if (atmosphere.LifeStage >= ComponentLifeStage.Stopping || atmosphere.Paused || !atmosphere.Simulated) if (atmosphere.LifeStage >= ComponentLifeStage.Stopping || Paused(atmosphere.Owner) || !atmosphere.Simulated)
continue; continue;
atmosphere.Timer += frameTime; atmosphere.Timer += frameTime;

View File

@@ -125,7 +125,7 @@ namespace Content.Server.Light.EntitySystems
continue; continue;
} }
if (handheld.Paused) continue; if (Paused(handheld.Owner)) continue;
TryUpdate(handheld, frameTime); TryUpdate(handheld, frameTime);
} }

View File

@@ -106,7 +106,7 @@ namespace Content.Server.Physics.Controllers
// then do the movement input once for it. // then do the movement input once for it.
foreach (var (shuttle, pilots) in _shuttlePilots) foreach (var (shuttle, pilots) in _shuttlePilots)
{ {
if (shuttle.Paused || !EntityManager.TryGetComponent((shuttle).Owner, out PhysicsComponent? body)) continue; if (Paused(shuttle.Owner) || !TryComp(shuttle.Owner, out PhysicsComponent? body)) continue;
// Collate movement linear and angular inputs together // Collate movement linear and angular inputs together
var linearInput = Vector2.Zero; var linearInput = Vector2.Zero;
@@ -129,7 +129,7 @@ namespace Content.Server.Physics.Controllers
if (sprint.Equals(Vector2.Zero)) continue; if (sprint.Equals(Vector2.Zero)) continue;
var offsetRotation = EntityManager.GetComponent<TransformComponent>((console).Owner).LocalRotation; var offsetRotation = EntityManager.GetComponent<TransformComponent>(console.Owner).LocalRotation;
linearInput += offsetRotation.RotateVec(new Vector2(0f, sprint.Y)); linearInput += offsetRotation.RotateVec(new Vector2(0f, sprint.Y));
angularInput += sprint.X; angularInput += sprint.X;

View File

@@ -387,7 +387,9 @@ namespace Content.Server.Shuttles.EntitySystems
foreach (var comp in _activeThrusters.ToArray()) foreach (var comp in _activeThrusters.ToArray())
{ {
if (!comp.Firing || comp.Damage == null || comp.Paused || comp.Deleted) continue; MetaDataComponent? metaData = null;
if (!comp.Firing || comp.Damage == null || Paused(comp.Owner, metaData) || Deleted(comp.Owner, metaData)) continue;
DebugTools.Assert(comp.Colliding.Count > 0); DebugTools.Assert(comp.Colliding.Count > 0);

View File

@@ -55,10 +55,12 @@ namespace Content.Server.Temperature.Systems
foreach (var comp in ShouldUpdateDamage) foreach (var comp in ShouldUpdateDamage)
{ {
if (comp.Deleted || comp.Paused) MetaDataComponent? metaData = null;
if (Deleted(comp.Owner, metaData) || Paused(comp.Owner, metaData))
continue; continue;
ChangeDamage((comp).Owner, comp); ChangeDamage(comp.Owner, comp);
} }
ShouldUpdateDamage.Clear(); ShouldUpdateDamage.Clear();