From f4786f2d9028ddb2fbd393b965fe2e48fd7afd7a Mon Sep 17 00:00:00 2001 From: slarticodefast <161409025+slarticodefast@users.noreply.github.com> Date: Thu, 31 Jul 2025 17:13:28 +0200 Subject: [PATCH] add QueueDeleteMap to SharedMapSystem (#6116) --- RELEASE-NOTES.md | 2 +- .../GameObjects/Systems/SharedMapSystem.Map.cs | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 3951ba4a0..17b90b53e 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -39,7 +39,7 @@ END TEMPLATE--> ### New features -*None yet* +* Added `SharedMapSystem.QueueDeleteMap`, which deletes a map with the specified MapId in the next tick. ### Bugfixes diff --git a/Robust.Shared/GameObjects/Systems/SharedMapSystem.Map.cs b/Robust.Shared/GameObjects/Systems/SharedMapSystem.Map.cs index fcbf288c3..e67148d39 100644 --- a/Robust.Shared/GameObjects/Systems/SharedMapSystem.Map.cs +++ b/Robust.Shared/GameObjects/Systems/SharedMapSystem.Map.cs @@ -262,12 +262,24 @@ public abstract partial class SharedMapSystem return (uid, AddComp(uid), meta); } + /// + /// Deletes a map with the specified map id. + /// public void DeleteMap(MapId mapId) { if (TryGetMap(mapId, out var uid)) Del(uid); } + /// + /// Deletes a map with the specified map id in the next tick. + /// + public void QueueDeleteMap(MapId mapId) + { + if (TryGetMap(mapId, out var uid)) + QueueDel(uid); + } + public IEnumerable GetAllMapIds() { return Maps.Keys;