Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 42 additions & 7 deletions Content.Server/GameTicking/GameTicker.RoundFlow.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using Content.Server._NF.PublicTransit.Components;
Expand Down Expand Up @@ -856,6 +857,27 @@ private async void SendRoundStartingDiscordMessage()
}
}

/// <summary>
/// Goes through a list and deletes specified prototype entities.
/// </summary>
private void QueueDeleteEntities(params string[] prototypeIds)
{
var cleanupPrototypeIds = prototypeIds.ToHashSet();
var metaQuery = EntityQueryEnumerator<MetaDataComponent>();

while (metaQuery.MoveNext(out var entityUid, out var metadata))
{
var prototype = metadata.EntityPrototype;
if (prototype == null)
continue;

if (cleanupPrototypeIds.Contains(prototype.ID))
{
QueueDel(entityUid);
}
}
}

/// <summary>
/// Cleanup that has to run to clear up anything from the previous round.
/// Stuff like wiping the previous map clean.
Expand Down Expand Up @@ -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<RescueBeaconComponent>();
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.

Expand Down
Loading