From 84d4c85b2fcadb0a5effe97ce81f718f6e73e850 Mon Sep 17 00:00:00 2001 From: BIGZi0348 Date: Wed, 1 Jan 2025 16:57:56 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=B0=D1=81=D1=80=D0=B0=D0=BB=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Xenoarchaeology/XenoArtifacts/ArtifactSystem.Nodes.cs | 2 +- .../Xenoarchaeology/XenoArtifacts/ArtifactSystem.cs | 4 ++-- .../_White/RandomArtifacts/RandomArtifactsSystem.cs | 6 +++++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Content.Server/Xenoarchaeology/XenoArtifacts/ArtifactSystem.Nodes.cs b/Content.Server/Xenoarchaeology/XenoArtifacts/ArtifactSystem.Nodes.cs index 9099d6d763..fd9e26aa15 100644 --- a/Content.Server/Xenoarchaeology/XenoArtifacts/ArtifactSystem.Nodes.cs +++ b/Content.Server/Xenoarchaeology/XenoArtifacts/ArtifactSystem.Nodes.cs @@ -245,7 +245,7 @@ public sealed partial class ArtifactSystem /// WD. /// Generate an Artifact tree with fully developed nodes. /// - private void GenerateSafeArtifactNodeTree(EntityUid artifact, List allNodes, int nodesToCreate) + private void GenerateSafeArtifactNodeTree(EntityUid artifact, ref List allNodes, int nodesToCreate) { if (nodesToCreate < 1) { diff --git a/Content.Server/Xenoarchaeology/XenoArtifacts/ArtifactSystem.cs b/Content.Server/Xenoarchaeology/XenoArtifacts/ArtifactSystem.cs index 253c42be03..927e9be321 100644 --- a/Content.Server/Xenoarchaeology/XenoArtifacts/ArtifactSystem.cs +++ b/Content.Server/Xenoarchaeology/XenoArtifacts/ArtifactSystem.cs @@ -300,12 +300,12 @@ public sealed partial class ArtifactSystem : EntitySystem /// WD. Randomize a given artifact. /// [PublicAPI] - public void SafeRandomizeArtifact(EntityUid uid, ArtifactComponent component) + public void SafeRandomizeArtifact(EntityUid uid, ref ArtifactComponent component) { component.NodesMax = 5; var nodeAmount = _random.Next(component.NodesMin, component.NodesMax); - GenerateSafeArtifactNodeTree(uid, component.NodeTree, nodeAmount); + GenerateSafeArtifactNodeTree(uid, ref component.NodeTree, nodeAmount); var firstNode = GetRootNode(component.NodeTree); EnterNode(uid, ref firstNode, component); } diff --git a/Content.Server/_White/RandomArtifacts/RandomArtifactsSystem.cs b/Content.Server/_White/RandomArtifacts/RandomArtifactsSystem.cs index 782b54ca79..eb423842d7 100644 --- a/Content.Server/_White/RandomArtifacts/RandomArtifactsSystem.cs +++ b/Content.Server/_White/RandomArtifacts/RandomArtifactsSystem.cs @@ -8,6 +8,7 @@ using Content.Shared.Stacks; using Content.Shared.Item; using Robust.Shared.Configuration; using Robust.Shared.Random; +using Robust.Server.GameObjects; namespace Content.Server._White.RandomArtifacts; @@ -61,8 +62,11 @@ public sealed class RandomArtifactsSystem : EntitySystem if (HasComp(entity)) continue; + if (HasComp(entity)) + continue; + var artifactComponent = EnsureComp(entity); - _artifactsSystem.SafeRandomizeArtifact(entity, artifactComponent); + _artifactsSystem.SafeRandomizeArtifact(entity, ref artifactComponent); EnsureComp(entity); }