server_crash_fix: OnPlayerGiveXP (#1929)

[fef0ed4072c8_worldserver.exe_.18-12_23-30-44.txt](https://github.com/user-attachments/files/24258638/fef0ed4072c8_worldserver.exe_.18-12_23-30-44.txt)

- Just added common logic and defense coding
- Optimized isRandombot while at it

Just for clarification i am aware the trigger of bug lies with the
progression mod. Regardless it should not happen.
This commit is contained in:
bashermens
2025-12-19 23:08:18 +01:00
committed by GitHub
parent b6f882886d
commit f5c84ee7ff
2 changed files with 23 additions and 31 deletions

View File

@@ -2594,17 +2594,14 @@ void RandomPlayerbotMgr::Refresh(Player* bot)
bool RandomPlayerbotMgr::IsRandomBot(Player* bot)
{
if (bot && GET_PLAYERBOT_AI(bot))
{
if (GET_PLAYERBOT_AI(bot)->IsRealPlayer())
return false;
}
if (bot)
{
return IsRandomBot(bot->GetGUID().GetCounter());
}
if (!bot)
return false;
return false;
PlayerbotAI* botAI = GET_PLAYERBOT_AI(bot);
if (!botAI || botAI->IsRealPlayer())
return false;
return IsRandomBot(bot->GetGUID().GetCounter());
}
bool RandomPlayerbotMgr::IsRandomBot(ObjectGuid::LowType bot)