prevent emitters being turned on or off when unanchored (#17303)

Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
deltanedas
2023-06-13 20:16:29 +00:00
committed by GitHub
parent 726f988a45
commit cbbebe22d8

View File

@@ -317,6 +317,10 @@ namespace Content.Server.Singularity.EntitySystems
private void OnSignalReceived(EntityUid uid, EmitterComponent component, ref SignalReceivedEvent args) private void OnSignalReceived(EntityUid uid, EmitterComponent component, ref SignalReceivedEvent args)
{ {
// must anchor the emitter for signals to work
if (TryComp<PhysicsComponent>(uid, out var phys) && phys.BodyType != BodyType.Static)
return;
if (args.Port == component.OffPort) if (args.Port == component.OffPort)
{ {
SwitchOff(uid, component); SwitchOff(uid, component);