mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-02-05 20:03:49 +00:00
Bug - Selfbot can trigger crash in printstats (#2013)
Adding a guard against bots that may be registered in `playerBots` variable as selfbot have appeared to crash here. Edit: The exact circumstances that caused the incorrect registration are under investigation as it seems to be 'atypical' behavior.
This commit is contained in:
@@ -3214,6 +3214,12 @@ void RandomPlayerbotMgr::PrintStats()
|
|||||||
lvlPerRace[bot->getRace()] += bot->GetLevel();
|
lvlPerRace[bot->getRace()] += bot->GetLevel();
|
||||||
|
|
||||||
PlayerbotAI* botAI = GET_PLAYERBOT_AI(bot);
|
PlayerbotAI* botAI = GET_PLAYERBOT_AI(bot);
|
||||||
|
if (!botAI)
|
||||||
|
{
|
||||||
|
LOG_ERROR("playerbots", "Player/Bot {} is registered in sRandomPlayerbotMgr playerBots and has no bot AI!", bot->GetName().c_str());
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (botAI->AllowActivity())
|
if (botAI->AllowActivity())
|
||||||
++active;
|
++active;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user