From f8d53d4cd87a887237986e4a2619b54c701f1dc0 Mon Sep 17 00:00:00 2001 From: Andrew <47818697+Nyeriah@users.noreply.github.com> Date: Tue, 12 Nov 2024 15:39:48 -0300 Subject: [PATCH] =?UTF-8?q?fix(Scripts/Commands):=20Fix=20crash=20when=20u?= =?UTF-8?q?sing=20npc=20set=20origin=20faction=20wi=E2=80=A6=20(#20536)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/server/scripts/Commands/cs_npc.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index a7daa3024..2cc199bd0 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -483,6 +483,9 @@ public: if (!player) return false; + if (!player->GetSelectedUnit()) + return false; + Creature* creature = player->GetSelectedUnit()->ToCreature(); if (!creature)