From 3bc576f7fbf70af86961bc2af2bc9c3dfdf964e6 Mon Sep 17 00:00:00 2001 From: bash <31279994+hermensbas@users.noreply.github.com> Date: Thu, 7 Aug 2025 00:54:15 +0200 Subject: [PATCH] Defense check on the player itself --- src/Playerbots.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Playerbots.cpp b/src/Playerbots.cpp index 42acba60..6e122fa9 100644 --- a/src/Playerbots.cpp +++ b/src/Playerbots.cpp @@ -209,8 +209,8 @@ public: void OnPlayerGiveXP(Player* player, uint32& amount, Unit* /*victim*/, uint8 /*xpSource*/) override { - // when default no XP scaling. - if (sPlayerbotAIConfig->randomBotXPRate == 1.0) + // early return + if (sPlayerbotAIConfig->randomBotXPRate == 1.0 || !player) return; // when player is no bot.