Defense check on the player itself

This commit is contained in:
bash
2025-08-07 00:54:15 +02:00
committed by GitHub
parent 7f64dc20c0
commit 3bc576f7fb

View File

@@ -209,8 +209,8 @@ public:
void OnPlayerGiveXP(Player* player, uint32& amount, Unit* /*victim*/, uint8 /*xpSource*/) override void OnPlayerGiveXP(Player* player, uint32& amount, Unit* /*victim*/, uint8 /*xpSource*/) override
{ {
// when default no XP scaling. // early return
if (sPlayerbotAIConfig->randomBotXPRate == 1.0) if (sPlayerbotAIConfig->randomBotXPRate == 1.0 || !player)
return; return;
// when player is no bot. // when player is no bot.