mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
Fix crash when bot re-logs
This commit is contained in:
@@ -1027,6 +1027,12 @@ void PlayerbotsMgr::AddPlayerbotData(Player* player, bool isBotAI)
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// If the guid already exists in the map, remove it
|
||||||
|
std::unordered_map<ObjectGuid, PlayerbotAIBase*>::iterator itr = _playerbotsMap.find(player->GetGUID());
|
||||||
|
if (itr != _playerbotsMap.end())
|
||||||
|
{
|
||||||
|
_playerbotsMap.erase(itr);
|
||||||
|
}
|
||||||
if (!isBotAI)
|
if (!isBotAI)
|
||||||
{
|
{
|
||||||
PlayerbotMgr* playerbotMgr = new PlayerbotMgr(player);
|
PlayerbotMgr* playerbotMgr = new PlayerbotMgr(player);
|
||||||
|
|||||||
Reference in New Issue
Block a user