From 6bc819eb46dd595705543a8aa82cd2891d696977 Mon Sep 17 00:00:00 2001 From: FaDeOkno Date: Mon, 21 Oct 2024 19:46:15 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9C=D0=B5=D0=BB=D0=BA=D0=B8=D0=B5=20=D0=BF?= =?UTF-8?q?=D1=80=D0=B0=D0=B2=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...nent.cs => GhostBarSpawnPointComponent.cs} | 0 .../{Components => }/GhostBarMapPrototype.cs | 0 .../Ghostbar/{ => Systems}/GhostBarSystem.cs | 20 ++++++++----------- 3 files changed, 8 insertions(+), 12 deletions(-) rename Content.Server/ADT/Ghostbar/Components/{GhostBarSpawnComponent.cs => GhostBarSpawnPointComponent.cs} (100%) rename Content.Server/ADT/Ghostbar/{Components => }/GhostBarMapPrototype.cs (100%) rename Content.Server/ADT/Ghostbar/{ => Systems}/GhostBarSystem.cs (85%) diff --git a/Content.Server/ADT/Ghostbar/Components/GhostBarSpawnComponent.cs b/Content.Server/ADT/Ghostbar/Components/GhostBarSpawnPointComponent.cs similarity index 100% rename from Content.Server/ADT/Ghostbar/Components/GhostBarSpawnComponent.cs rename to Content.Server/ADT/Ghostbar/Components/GhostBarSpawnPointComponent.cs diff --git a/Content.Server/ADT/Ghostbar/Components/GhostBarMapPrototype.cs b/Content.Server/ADT/Ghostbar/GhostBarMapPrototype.cs similarity index 100% rename from Content.Server/ADT/Ghostbar/Components/GhostBarMapPrototype.cs rename to Content.Server/ADT/Ghostbar/GhostBarMapPrototype.cs diff --git a/Content.Server/ADT/Ghostbar/GhostBarSystem.cs b/Content.Server/ADT/Ghostbar/Systems/GhostBarSystem.cs similarity index 85% rename from Content.Server/ADT/Ghostbar/GhostBarSystem.cs rename to Content.Server/ADT/Ghostbar/Systems/GhostBarSystem.cs index ae3d96d188f..02a7a875d7d 100644 --- a/Content.Server/ADT/Ghostbar/GhostBarSystem.cs +++ b/Content.Server/ADT/Ghostbar/Systems/GhostBarSystem.cs @@ -37,7 +37,7 @@ public sealed class GhostBarSystem : EntitySystem [Dependency] private readonly IPrototypeManager _prototypeManager = default!; [Dependency] private readonly StealthSystem _stealth = default!; [Dependency] private readonly PopupSystem _popupSystem = default!; - public GhostBarMapPrototype? GhostBarMap; /// его значение нельзя объявить методом. Много проб, ни одна из них не успешна, даже в гугле информации про такое нету. + public GhostBarMapPrototype? GhostBarMap; // Существует для того, чтобы посетители гост бара спавнились соответственно его настройкам. Если значение равно null во время раунда - что-то сломано public override void Initialize() { SubscribeLocalEvent(OnRoundStart); @@ -55,21 +55,18 @@ private void OnRoundStart(RoundStartingEvent ev) var mapProto = GhostBarMap; - if (_mapLoader.TryLoad(mapId, mapProto.Path, out _, options)) - { - _mapSystem.SetPaused(mapId, false); - if (mapProto.Weather.HasValue) - { - TimeSpan? endTime = null; - _weathersystem.SetWeather(mapId, _prototypeManager.Index(mapProto.Weather.Value), endTime); - } - } + if (!_mapLoader.TryLoad(mapId, mapProto.Path, out _, options)) + return; + + _mapSystem.SetPaused(mapId, false); + if (mapProto.Weather.HasValue) + _weathersystem.SetWeather(mapId, _prototypeManager.Index(mapProto.Weather.Value), null); } private void OnPlayerGhosted(EntityUid uid, GhostBarPlayerComponent component, MindRemovedMessage args) { QueueDel(uid); - Spawn("PolymorphAshJauntAnimation", Transform(uid).Coordinates); // Спавн пепла при удалении, дабы выглядело чутка лучше + Spawn("PolymorphAshJauntAnimation", Transform(uid).Coordinates); // Сугубо визуал } public void SpawnPlayer(GhostBarSpawnEvent msg, EntitySessionEventArgs args) @@ -109,7 +106,6 @@ public void SpawnPlayer(GhostBarSpawnEvent msg, EntitySessionEventArgs args) { EnsureComp(mobUid); _stealth.SetVisibility(mobUid, GhostBarMap.Ghosted); - } var targetMind = _mindSystem.GetMind(args.SenderSession.UserId);