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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -317,6 +317,10 @@ namespace Content.Server.Singularity.EntitySystems
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)
{
SwitchOff(uid, component);