Cleanups PolymorphSystem/Components/Prototypes (#23721)
* Cleanups PolymorphSystem * forgot this * Nah * Fix test --------- Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
@@ -1,39 +1,38 @@
|
||||
using Content.Shared.GameTicking;
|
||||
|
||||
namespace Content.Server.Polymorph.Systems
|
||||
namespace Content.Server.Polymorph.Systems;
|
||||
|
||||
public sealed partial class PolymorphSystem
|
||||
{
|
||||
public sealed partial class PolymorphSystem
|
||||
public EntityUid? PausedMap { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Used to subscribe to the round restart event
|
||||
/// </summary>
|
||||
private void InitializeMap()
|
||||
{
|
||||
public EntityUid? PausedMap { get; private set; }
|
||||
SubscribeLocalEvent<RoundRestartCleanupEvent>(OnRoundRestart);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Used to subscribe to the round restart event
|
||||
/// </summary>
|
||||
private void InitializeMap()
|
||||
{
|
||||
SubscribeLocalEvent<RoundRestartCleanupEvent>(OnRoundRestart);
|
||||
}
|
||||
private void OnRoundRestart(RoundRestartCleanupEvent _)
|
||||
{
|
||||
if (PausedMap == null || !Exists(PausedMap))
|
||||
return;
|
||||
|
||||
private void OnRoundRestart(RoundRestartCleanupEvent _)
|
||||
{
|
||||
if (PausedMap == null || !Exists(PausedMap))
|
||||
return;
|
||||
Del(PausedMap.Value);
|
||||
}
|
||||
|
||||
EntityManager.DeleteEntity(PausedMap.Value);
|
||||
}
|
||||
/// <summary>
|
||||
/// Used internally to ensure a paused map that is
|
||||
/// stores polymorphed entities.
|
||||
/// </summary>
|
||||
private void EnsurePausedMap()
|
||||
{
|
||||
if (PausedMap != null && Exists(PausedMap))
|
||||
return;
|
||||
|
||||
/// <summary>
|
||||
/// Used internally to ensure a paused map that is
|
||||
/// stores polymorphed entities.
|
||||
/// </summary>
|
||||
private void EnsurePausesdMap()
|
||||
{
|
||||
if (PausedMap != null && Exists(PausedMap))
|
||||
return;
|
||||
|
||||
var newmap = _mapManager.CreateMap();
|
||||
_mapManager.SetMapPaused(newmap, true);
|
||||
PausedMap = _mapManager.GetMapEntityId(newmap);
|
||||
}
|
||||
var newmap = _mapManager.CreateMap();
|
||||
_mapManager.SetMapPaused(newmap, true);
|
||||
PausedMap = _mapManager.GetMapEntityId(newmap);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user