From 157110ebd0f9daab524cc5163fae030688fa6e2e Mon Sep 17 00:00:00 2001 From: insunaa Date: Sun, 15 Sep 2024 19:19:40 +0200 Subject: [PATCH] Playerbots: Fix deadlock on shutdown and AHBot spam --- src/game/World/World.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/game/World/World.cpp b/src/game/World/World.cpp index 5119e9a124..0a40071ea7 100644 --- a/src/game/World/World.cpp +++ b/src/game/World/World.cpp @@ -165,13 +165,13 @@ World::~World() /// Cleanups before world stop void World::CleanupsBeforeStop() { +#ifdef ENABLE_PLAYERBOTS + sRandomPlayerbotMgr.LogoutAllBots(); +#endif KickAll(true); // save and kick all players UpdateSessions(1); // real players unload required UpdateSessions call sBattleGroundMgr.DeleteAllBattleGrounds(); // unload battleground templates before different singletons destroyed sMapMgr.UnloadAll(); // unload all grids (including locked in memory) -#ifdef ENABLE_PLAYERBOTS - sRandomPlayerbotMgr.LogoutAllBots(); -#endif } /// Find a session by its id @@ -1476,6 +1476,9 @@ void World::SetInitialWorldSettings() #ifdef ENABLE_PLAYERBOTS sPlayerbotAIConfig.Initialize(); +#ifndef BUILD_AHBOT + auctionbot.Init(); +#endif #endif sLog.outString("---------------------------------------");