From c80b10a68846fd851facfbd29b4a76a809cfcea9 Mon Sep 17 00:00:00 2001 From: Remuchi Date: Sun, 28 Jan 2024 16:50:21 +0700 Subject: [PATCH] =?UTF-8?q?fix:=20=D0=A2=D1=82=D0=B5=D0=BB=D0=B5=D0=BF?= =?UTF-8?q?=D0=BE=D1=80=D1=82=20=D0=BA=D1=83=D0=BB=D1=8C=D1=82=D0=B0=20?= =?UTF-8?q?=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=B0=D0=B5=D1=82=20=D1=82=D0=BE?= =?UTF-8?q?=D0=BB=D1=8C=D0=BA=D0=BE=20=D0=BD=D0=B0=20=D0=BA=D1=83=D0=BB?= =?UTF-8?q?=D1=8C=D1=82=D0=B8=D1=81=D1=82=D0=BE=D0=B2=20=D0=B8=D0=BB=D0=B8?= =?UTF-8?q?=20=D0=BB=D0=B5=D0=B6=D0=B0=D1=87=D0=B8=D1=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Cult/Runes/Systems/CultSystem.Actions.cs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Content.Server/_White/Cult/Runes/Systems/CultSystem.Actions.cs b/Content.Server/_White/Cult/Runes/Systems/CultSystem.Actions.cs index 8bbcb5d651..a3a7892fe3 100644 --- a/Content.Server/_White/Cult/Runes/Systems/CultSystem.Actions.cs +++ b/Content.Server/_White/Cult/Runes/Systems/CultSystem.Actions.cs @@ -5,12 +5,13 @@ using Content.Server.Emp; using Content.Server.EUI; using Content.Server.White.Cult.UI; using Content.Shared.Chemistry.Components; -using Content.Shared.Chemistry.EntitySystems; using Content.Shared.Damage; using Content.Shared.Damage.Prototypes; using Content.Shared.FixedPoint; using Content.Shared.Fluids.Components; using Content.Shared.Inventory; +using Content.Shared.Mobs; +using Content.Shared.Mobs.Components; using Content.Shared.Stacks; using Content.Shared.StatusEffect; using Content.Shared.Stunnable; @@ -29,6 +30,7 @@ public partial class CultSystem [Dependency] private readonly EmpSystem _empSystem = default!; [Dependency] private readonly EuiManager _euiManager = default!; [Dependency] private readonly InventorySystem _inventorySystem = default!; + [Dependency] private readonly TransformSystem _transform = default!; public void InitializeActions() { @@ -59,6 +61,14 @@ public partial class CultSystem if (!TryComp(args.Performer, out _) || !TryComp(uid, out var actor)) return; + if (!TryComp(args.Target, out _) && + !(TryComp(args.Target, out var mobStateComponent) && + mobStateComponent.CurrentState is not MobState.Alive)) + { + _popupSystem.PopupEntity("Цель должна быть культистом или лежать", args.Performer); + return; + } + var eui = new TeleportSpellEui(args.Performer, args.Target); _euiManager.OpenEui(eui, actor.PlayerSession); eui.StateDirty(); @@ -76,7 +86,7 @@ public partial class CultSystem var xform = Transform(uid); - var entitiesInRange = _lookup.GetEntitiesInRange(xform.MapPosition, 1.5f); + var entitiesInRange = _lookup.GetEntitiesInRange(_transform.GetMapCoordinates(xform), 1.5f); FixedPoint2 totalBloodAmount = 0f;