From d99f822bbd2e7e559bc04a2c67eb9534411b0405 Mon Sep 17 00:00:00 2001 From: JDtrimble Date: Mon, 29 Jul 2024 18:45:36 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B1=D0=BE=D0=BB=D0=B5=D0=B5=20=D0=BD=D0=B0?= =?UTF-8?q?=D0=B4=D0=B5=D0=B6=D0=BD=D1=8B=D0=B9=20=D0=BC=D0=B5=D1=82=D0=BE?= =?UTF-8?q?=D0=B4=20=D0=B2=D0=B7=D1=8F=D1=82=D0=B8=D1=8F=20=D1=82=D1=80?= =?UTF-8?q?=D0=B0=D0=BD=D1=81=D1=84=D0=BE=D1=80=D0=BC=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: JDtrimble --- Content.Server/_Sunrise/Smile/SmileSlimeSystem.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Content.Server/_Sunrise/Smile/SmileSlimeSystem.cs b/Content.Server/_Sunrise/Smile/SmileSlimeSystem.cs index 6610583f025..037de447185 100644 --- a/Content.Server/_Sunrise/Smile/SmileSlimeSystem.cs +++ b/Content.Server/_Sunrise/Smile/SmileSlimeSystem.cs @@ -76,7 +76,9 @@ private void OnLoveAction(EntityUid smileUid, SmileSlimeComponent comp, SmileLov CancelDuplicate = true, }; - var targetXform = Transform(args.Target); + if (!TryComp(args.Target, out var targetXform)) + return; + _audio.PlayPvs(comp.SoundSpecifier, targetXform.Coordinates); _entMan.SpawnEntity("EffectHearts", targetXform.Coordinates); _popupSystem.PopupEntity( @@ -98,7 +100,9 @@ private void OnDoAfter(EntityUid uid, SmileSlimeComponent comp, SmileLoveDoAfter if (args.Target == null) return; - var targetXform = Transform(args.Target.Value); + if (!TryComp(args.Target.Value, out var targetXform)) + return; + _entMan.SpawnEntity("EffectHearts", targetXform.Coordinates); _audio.PlayPvs(comp.SoundSpecifier, targetXform.Coordinates); _damageableSystem.TryChangeDamage(args.Target, comp.DamageSpecifier, true, false);