Set mover velocity via system (#6288)

This commit is contained in:
metalgearsloth
2022-02-02 17:34:25 +11:00
committed by GitHub
parent 0349a854ac
commit 2e5808085d
12 changed files with 44 additions and 47 deletions

View File

@@ -19,7 +19,7 @@ namespace Content.Server.Audio
if (!EntityManager.TryGetComponent<AmbientSoundComponent>(uid, out var ambientSound)) return;
if (ambientSound.Enabled == args.Supply) return;
ambientSound.Enabled = args.Supply;
ambientSound.Dirty();
Dirty(ambientSound);
}
private void HandlePowerChange(EntityUid uid, AmbientOnPoweredComponent component, PowerChangedEvent args)
@@ -27,7 +27,7 @@ namespace Content.Server.Audio
if (!EntityManager.TryGetComponent<AmbientSoundComponent>(uid, out var ambientSound)) return;
if (ambientSound.Enabled == args.Powered) return;
ambientSound.Enabled = args.Powered;
ambientSound.Dirty();
Dirty(ambientSound);
}
}
}

View File

@@ -94,7 +94,7 @@ namespace Content.Server.Buckle.Systems
continue;
}
buckled.ReAttach(strap);
buckled.Dirty();
Dirty(buckled);
}
}

View File

@@ -223,7 +223,8 @@ namespace Content.Server.Cargo
{
if (comp.Database == null || comp.Database.Id != id)
continue;
comp.Dirty();
Dirty(comp);
}
}
}

View File

@@ -20,7 +20,7 @@ namespace Content.Server.Chemistry.EntitySystems
private void OnSolutionChange(EntityUid uid, HyposprayComponent component, SolutionChangedEvent args)
{
component.Dirty();
Dirty(component);
}
public void OnAfterInteract(EntityUid uid, HyposprayComponent comp, AfterInteractEvent args)

View File

@@ -28,7 +28,7 @@ namespace Content.Server.Chemistry.EntitySystems
private void OnSolutionChange(EntityUid uid, InjectorComponent component, SolutionChangedEvent args)
{
component.Dirty();
Dirty(component);
}
}
}

View File

@@ -122,7 +122,7 @@ namespace Content.Server.Cuffs
{
cuffable.CanStillInteract = handCount > cuffable.CuffedHandCount;
cuffable.CuffedStateChanged();
cuffable.Dirty();
Dirty(cuffable);
}
}
}

View File

@@ -417,7 +417,7 @@ namespace Content.Server.Disposal.Unit.EntitySystems
}
if (count != component.RecentlyEjected.Count)
component.Dirty();
Dirty(component);
return state == SharedDisposalUnitComponent.PressureState.Ready && component.RecentlyEjected.Count == 0;
}
@@ -604,7 +604,7 @@ namespace Content.Server.Disposal.Unit.EntitySystems
if (!component.RecentlyEjected.Contains(entity))
component.RecentlyEjected.Add(entity);
component.Dirty();
Dirty(component);
HandleStateChange(component, true);
UpdateVisualState(component);
}

View File

@@ -124,7 +124,7 @@ namespace Content.Server.Flash
{
flashable.LastFlash = _gameTiming.CurTime;
flashable.Duration = flashDuration / 1000f; // TODO: Make this sane...
flashable.Dirty();
Dirty(flashable);
_stunSystem.TrySlowdown(target, TimeSpan.FromSeconds(flashDuration/1000f), true,
slowTo, slowTo);

View File

@@ -49,10 +49,10 @@ namespace Content.Server.Physics.Controllers
base.UpdateBeforeSolve(prediction, frameTime);
_excludedMobs.Clear();
foreach (var (mobMover, mover, physics) in EntityManager.EntityQuery<IMobMoverComponent, IMoverComponent, PhysicsComponent>())
foreach (var (mobMover, mover, physics, xform) in EntityManager.EntityQuery<IMobMoverComponent, IMoverComponent, PhysicsComponent, TransformComponent>())
{
_excludedMobs.Add(mover.Owner);
HandleMobMovement(mover, physics, mobMover);
HandleMobMovement(mover, physics, mobMover, xform);
}
HandleShuttleMovement(frameTime);

View File

@@ -17,7 +17,7 @@ namespace Content.Server.Weapon.Ranged
// Instead of dirtying on hand-select this component should probably by dirtied whenever it needs to be.
// I take no responsibility for this code. It was like this when I got here.
component.Dirty();
Dirty(component);
}
}
}