Skip to content

Commit

Permalink
Playerbots: Fix build error caused by iterator refactor
Browse files Browse the repository at this point in the history
Recently, `GetPlayerBotsBegin()` and `GetPlayerBotsEnd()` were removed from the PlayerBots code in favor of a new function called `ForEachPlayerbot()`. `ChatHandler.cpp` seems to have been the only file that was using the old functions, everything builds fine with this fix.
  • Loading branch information
Limezero authored and davidonete committed Apr 20, 2024
1 parent 4a6e4f7 commit 43f3028
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/game/Chat/ChatHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -390,14 +390,13 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recv_data)
PlayerbotMgr* mgr = GetPlayer()->GetPlayerbotMgr();
if (mgr && GetPlayer()->GetGuildId())
{
for (PlayerBotMap::const_iterator it = mgr->GetPlayerBotsBegin(); it != mgr->GetPlayerBotsEnd(); ++it)
mgr->ForEachPlayerbot([&](Player* const bot)
{
Player* const bot = it->second;
if (bot->GetGuildId() == GetPlayer()->GetGuildId())
{
bot->GetPlayerbotAI()->HandleCommand(type, msg, *GetPlayer(), lang);
}
}
});
}

sRandomPlayerbotMgr.HandleCommand(type, msg, *_player, "", GetPlayer()->GetTeam(), lang);
Expand Down

0 comments on commit 43f3028

Please sign in to comment.