diff --git a/Content.Server/GameObjects/EntitySystems/PlantSystem.cs b/Content.Server/GameObjects/EntitySystems/PlantSystem.cs index 4f60d22aa5..6227dedc4e 100644 --- a/Content.Server/GameObjects/EntitySystems/PlantSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/PlantSystem.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using Content.Server.Botany; using Content.Server.GameObjects.Components.Botany; +using Content.Shared.GameTicking; using JetBrains.Annotations; using Robust.Shared.GameObjects.Systems; using Robust.Shared.Interfaces.GameObjects; @@ -12,7 +13,7 @@ using Robust.Shared.Prototypes; namespace Content.Server.GameObjects.EntitySystems { [UsedImplicitly] - public class PlantSystem : EntitySystem + public class PlantSystem : EntitySystem, IResettingEntitySystem { [Dependency] private readonly IComponentManager _componentManager = default!; [Dependency] private readonly IPrototypeManager _prototypeManager = default!; @@ -29,6 +30,15 @@ namespace Content.Server.GameObjects.EntitySystems { base.Initialize(); + PopulateDatabase(); + } + + private void PopulateDatabase() + { + _nextUid = 0; + + _seeds.Clear(); + foreach (var seed in _prototypeManager.EnumeratePrototypes()) { AddSeedToDatabase(seed); @@ -66,5 +76,10 @@ namespace Content.Server.GameObjects.EntitySystems plantHolder.Update(); } } + + public void Reset() + { + PopulateDatabase(); + } } }