mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-14 09:29:09 +00:00
Revert "Feat: Filter bot logins by level range" (#1705)
This commit is contained in:
@@ -87,8 +87,7 @@ public:
|
||||
PLAYERHOOK_ON_BEFORE_CRITERIA_PROGRESS,
|
||||
PLAYERHOOK_ON_BEFORE_ACHI_COMPLETE,
|
||||
PLAYERHOOK_CAN_PLAYER_USE_PRIVATE_CHAT,
|
||||
PLAYERHOOK_ON_GIVE_EXP,
|
||||
PLAYERHOOK_ON_LEVEL_CHANGED
|
||||
PLAYERHOOK_ON_GIVE_EXP
|
||||
}) {}
|
||||
|
||||
void OnPlayerLogin(Player* player) override
|
||||
@@ -122,33 +121,6 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void OnPlayerLevelChanged(Player* player, uint8 oldLevel) override
|
||||
{
|
||||
// Check if feature is enabled and required objects are valid
|
||||
if (!sPlayerbotAIConfig || !sPlayerbotAIConfig->randomBotLogoutOutsideLoginRange || !sRandomPlayerbotMgr)
|
||||
return;
|
||||
|
||||
// Only apply to bots from rndBotTypeAccounts (type 1)
|
||||
uint32 accountId = player->GetSession()->GetAccountId();
|
||||
if (!sRandomPlayerbotMgr->IsAccountType(accountId, 1))
|
||||
return;
|
||||
|
||||
uint32 newLevel = player->GetLevel();
|
||||
|
||||
// Check if the new level is outside the allowed login range
|
||||
if (newLevel < sPlayerbotAIConfig->randomBotMinLoginLevel ||
|
||||
newLevel > sPlayerbotAIConfig->randomBotMaxLoginLevel)
|
||||
{
|
||||
LOG_INFO("playerbots", "Bot {} changed levels from {} to {}, outside login range ({}-{}). Marking for logout",
|
||||
player->GetName(), oldLevel, newLevel,
|
||||
sPlayerbotAIConfig->randomBotMinLoginLevel, sPlayerbotAIConfig->randomBotMaxLoginLevel);
|
||||
|
||||
// Mark the bot for removal in the next update cycle
|
||||
sRandomPlayerbotMgr->MarkBotForLogout(player->GetGUID().GetCounter());
|
||||
sRandomPlayerbotMgr->ForceRecount();
|
||||
}
|
||||
}
|
||||
|
||||
void OnPlayerAfterUpdate(Player* player, uint32 diff) override
|
||||
{
|
||||
if (PlayerbotAI* botAI = GET_PLAYERBOT_AI(player))
|
||||
|
||||
Reference in New Issue
Block a user