From: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> Date: Thu, 23 Mar 2023 01:44:37 +0000 (-0400) Subject: fix spawn artifact system (#14779) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=f8bed49836d251b83e1bdfa6ff53a4b02cdc336e;p=space-station-14.git fix spawn artifact system (#14779) --- diff --git a/Content.Server/Xenoarchaeology/XenoArtifacts/Effects/Systems/SpawnArtifactSystem.cs b/Content.Server/Xenoarchaeology/XenoArtifacts/Effects/Systems/SpawnArtifactSystem.cs index 1f260a1890..4ac173a160 100644 --- a/Content.Server/Xenoarchaeology/XenoArtifacts/Effects/Systems/SpawnArtifactSystem.cs +++ b/Content.Server/Xenoarchaeology/XenoArtifacts/Effects/Systems/SpawnArtifactSystem.cs @@ -1,6 +1,7 @@ using Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Components; using Content.Server.Xenoarchaeology.XenoArtifacts.Events; using Content.Shared.Storage; +using Robust.Server.GameObjects; using Robust.Shared.Random; namespace Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Systems; @@ -9,6 +10,7 @@ public sealed class SpawnArtifactSystem : EntitySystem { [Dependency] private readonly IRobustRandom _random = default!; [Dependency] private readonly ArtifactSystem _artifact = default!; + [Dependency] private readonly TransformSystem _transform = default!; public const string NodeDataSpawnAmount = "nodeDataSpawnAmount"; @@ -35,7 +37,8 @@ public sealed class SpawnArtifactSystem : EntitySystem var dx = _random.NextFloat(-component.Range, component.Range); var dy = _random.NextFloat(-component.Range, component.Range); var spawnCord = artifactCord.Offset(new Vector2(dx, dy)); - EntityManager.SpawnEntity(spawn, spawnCord); + var ent = Spawn(spawn, spawnCord); + _transform.AttachToGridOrMap(ent); } _artifact.SetNodeData(uid, NodeDataSpawnAmount, amount + 1); }