From 51e8411310244916997bcddf7baa87350e6a9dab Mon Sep 17 00:00:00 2001 From: KTDR <140620960+KTDR228337@users.noreply.github.com> Date: Thu, 19 Oct 2023 17:32:41 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A4=D0=B8=D0=BA=D1=81=20=D1=81=D0=BE=D0=B1?= =?UTF-8?q?=D1=8B=D1=82=D0=B8=D1=8F=20"=D0=A1=D0=BA=D0=B5=D0=BB=D0=B5?= =?UTF-8?q?=D1=82=20=D0=B8=D0=B7=20=D1=88=D0=BA=D0=B0=D1=84=D0=B0"=20(#277?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * delete skeleton event * fix * uncommented ClosetSkeleton * fix 2 --- .../StationEvents/Events/RandomEntityStorageSpawnRule.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Content.Server/StationEvents/Events/RandomEntityStorageSpawnRule.cs b/Content.Server/StationEvents/Events/RandomEntityStorageSpawnRule.cs index c3cd719cc4c..f8122ad7e3f 100644 --- a/Content.Server/StationEvents/Events/RandomEntityStorageSpawnRule.cs +++ b/Content.Server/StationEvents/Events/RandomEntityStorageSpawnRule.cs @@ -10,6 +10,7 @@ namespace Content.Server.StationEvents.Events; public sealed class RandomEntityStorageSpawnRule : StationEventSystem { [Dependency] private readonly EntityStorageSystem _entityStorage = default!; + [Dependency] private readonly SharedTransformSystem _transform = default!; protected override void Started(EntityUid uid, RandomEntityStorageSpawnRuleComponent comp, GameRuleComponent gameRule, GameRuleStartedEvent args) { @@ -18,8 +19,8 @@ protected override void Started(EntityUid uid, RandomEntityStorageSpawnRuleCompo if (!TryGetRandomStation(out var station)) return; - var validLockers = new List<(EntityUid, EntityStorageComponent)>(); var spawn = Spawn(comp.Prototype, MapCoordinates.Nullspace); + var validLockers = new List<(EntityUid, EntityStorageComponent, TransformComponent)>(); var query = EntityQueryEnumerator(); while (query.MoveNext(out var ent, out var storage, out var xform)) @@ -30,7 +31,7 @@ protected override void Started(EntityUid uid, RandomEntityStorageSpawnRuleCompo if (!_entityStorage.CanInsert(spawn, ent, storage)) continue; - validLockers.Add((ent, storage)); + validLockers.Add((ent, storage, xform)); } if (validLockers.Count == 0) @@ -39,7 +40,8 @@ protected override void Started(EntityUid uid, RandomEntityStorageSpawnRuleCompo return; } - var (locker, storageComp) = RobustRandom.Pick(validLockers); + var (locker, storageComp, lockerPos) = RobustRandom.Pick(validLockers); + _transform.SetCoordinates(spawn, lockerPos.Coordinates); if (!_entityStorage.Insert(spawn, locker, storageComp)) { Del(spawn);