Skip to content

Commit

Permalink
Playerbots: Fix deadlock on shutdown and AHBot spam
Browse files Browse the repository at this point in the history
  • Loading branch information
insunaa committed Sep 15, 2024
1 parent 713cc7c commit d8294cd
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/game/World/World.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -1476,6 +1476,9 @@ void World::SetInitialWorldSettings()

#ifdef ENABLE_PLAYERBOTS
sPlayerbotAIConfig.Initialize();
#ifndef BUILD_AHBOT
auctionbot.Init();
#endif
#endif

sLog.outString("---------------------------------------");
Expand Down

0 comments on commit d8294cd

Please sign in to comment.