diff --git a/Content.Server/GameTicking/GameTicker.RoundFlow.cs b/Content.Server/GameTicking/GameTicker.RoundFlow.cs index 06b8352475d..5d00986f0c9 100644 --- a/Content.Server/GameTicking/GameTicker.RoundFlow.cs +++ b/Content.Server/GameTicking/GameTicker.RoundFlow.cs @@ -1,3 +1,4 @@ +using System.Collections.Generic; using System.Linq; using System.Numerics; using Content.Server._NF.PublicTransit.Components; @@ -856,6 +857,27 @@ private async void SendRoundStartingDiscordMessage() } } + /// + /// Goes through a list and deletes specified prototype entities. + /// + private void QueueDeleteEntities(params string[] prototypeIds) + { + var cleanupPrototypeIds = prototypeIds.ToHashSet(); + var metaQuery = EntityQueryEnumerator(); + + while (metaQuery.MoveNext(out var entityUid, out var metadata)) + { + var prototype = metadata.EntityPrototype; + if (prototype == null) + continue; + + if (cleanupPrototypeIds.Contains(prototype.ID)) + { + QueueDel(entityUid); + } + } + } + /// /// Cleanup that has to run to clear up anything from the previous round. /// Stuff like wiping the previous map clean. @@ -892,13 +914,26 @@ private void ResettingCleanup() _gameMapManager.ClearSelectedMap(); - // Hardlight start - Delete all rescue beacons from the previous round before the new map loads - var rescueBeaconQuery = EntityQueryEnumerator(); - while (rescueBeaconQuery.MoveNext(out var beaconUid, out var beacon)) - { - QueueDel(beaconUid); - } - // Hardlight end + // Hardlight - Delete specified entities before new map loads, items that have the potential to break round progression + QueueDeleteEntities( + "RescueBeacon", + "NukeDisk", + "PinpointerNuclear", + "HandTeleporter", + "BoxFolderQmClipboard", + "DoorRemoteArmory", + "DoorRemoteCargo", + "DoorRemoteEngineering", + "DoorRemoteMedical", + "DoorRemoteResearch", + "DoorRemoteSecurity", + "DoorRemoteService", + "DoorRemoteCustom", + "DoorRemoteCommand", + "PinpointerMothership", + "Demag", + "EncryptionKeySyndie" + ); // Clear up any game rules.