mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-13 00:58:33 +00:00
Fix playerbots database request queue stacking (#870)
* Clear added random bots on server start * Remove duplicate set login event * Remove login event value * Remove deletion of add event value
This commit is contained in:
@@ -1065,16 +1065,11 @@ bool RandomPlayerbotMgr::ProcessBot(uint32 bot)
|
||||
return false;
|
||||
}
|
||||
|
||||
uint32 isLogginIn = GetEventValue(bot, "login");
|
||||
if (isLogginIn)
|
||||
return false;
|
||||
|
||||
uint32 randomTime;
|
||||
if (!player)
|
||||
{
|
||||
AddPlayerBot(botGUID, 0);
|
||||
randomTime = urand(1, 2);
|
||||
SetEventValue(bot, "login", 1, randomTime);
|
||||
|
||||
uint32 randomBotUpdateInterval = _isBotInitializing ? 1 : sPlayerbotAIConfig->randomBotUpdateInterval;
|
||||
randomTime = urand(std::max(5, static_cast<int>(randomBotUpdateInterval * 0.5)),
|
||||
@@ -1097,8 +1092,6 @@ bool RandomPlayerbotMgr::ProcessBot(uint32 bot)
|
||||
return true;
|
||||
}
|
||||
|
||||
SetEventValue(bot, "login", 0, 0);
|
||||
|
||||
if (!player->IsInWorld())
|
||||
return false;
|
||||
|
||||
@@ -2504,7 +2497,6 @@ void RandomPlayerbotMgr::OnPlayerLogin(Player* player)
|
||||
if (IsRandomBot(player))
|
||||
{
|
||||
ObjectGuid::LowType guid = player->GetGUID().GetCounter();
|
||||
SetEventValue(guid, "login", 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user