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;