fix spawn artifact system (#14779)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user