Make CloningSystem properly reset and not use static (#2448)
This commit is contained in:
@@ -2,11 +2,12 @@
|
||||
using System.Linq;
|
||||
using Content.Server.GameObjects.Components.Medical;
|
||||
using Content.Server.Mobs;
|
||||
using Content.Shared.GameTicking;
|
||||
using Robust.Shared.GameObjects.Systems;
|
||||
|
||||
namespace Content.Server.GameObjects.EntitySystems
|
||||
{
|
||||
internal sealed class CloningSystem : EntitySystem
|
||||
internal sealed class CloningSystem : EntitySystem, IResettingEntitySystem
|
||||
{
|
||||
public override void Update(float frameTime)
|
||||
{
|
||||
@@ -16,9 +17,9 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
}
|
||||
}
|
||||
|
||||
public static Dictionary<int, Mind> Minds = new Dictionary<int, Mind>();
|
||||
public readonly Dictionary<int, Mind> Minds = new Dictionary<int, Mind>();
|
||||
|
||||
public static void AddToDnaScans(Mind mind)
|
||||
public void AddToDnaScans(Mind mind)
|
||||
{
|
||||
if (!Minds.ContainsValue(mind))
|
||||
{
|
||||
@@ -26,14 +27,19 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
}
|
||||
}
|
||||
|
||||
public static bool HasDnaScan(Mind mind)
|
||||
public bool HasDnaScan(Mind mind)
|
||||
{
|
||||
return Minds.ContainsValue(mind);
|
||||
}
|
||||
|
||||
public static Dictionary<int, string> getIdToUser()
|
||||
public Dictionary<int, string> GetIdToUser()
|
||||
{
|
||||
return Minds.ToDictionary(m => m.Key, m => m.Value.CharacterName);
|
||||
}
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
Minds.Clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user