ZhengPeiRu21 / mod-playerbots

AzerothCore Playerbots Module
MIT License
193 stars 93 forks source link

副本满人时,进入副本的机器人会导致服务器崩溃 #153

Open demibug opened 1 year ago

demibug commented 1 year ago

组一个超过5人的raid队伍, 里面都是玩家的小号机器人, 玩家先进入怒焰裂谷, 然后在团队频道输入summon, 服务器崩溃

demibug commented 1 year ago

看了一下代码好像是大号召唤小号的时候小号会先把自己从地图上删除,然后副本地图满了,又会把小号传回炉石绑定的地点,但是这个时候原先炉石绑定的地图里没有这个角色,接着就会崩溃. 尝试修改了一下 MovementHandler.cpp 里的 void WorldSession::HandleMoveWorldportAck() 函数下把 if (!newMap || newMap->CannotEnter(GetPlayer(), false)) { LOG_ERROR("network.opcode", "Map {} could not be created for player {}, porting player to homebind", loc.GetMapId(), GetPlayer()->GetGUID().ToString()); GetPlayer()->TeleportTo(GetPlayer()->m_homebindMapId, GetPlayer()->m_homebindX, GetPlayer()->m_homebindY, GetPlayer()->m_homebindZ, GetPlayer()->m_homebindO); return; } 修改为 if (!newMap || newMap->CannotEnter(GetPlayer(), false)) { LOG_ERROR("network.opcode", "Map {} could not be created for player {}, porting player to homebind", loc.GetMapId(), GetPlayer()->GetGUID().ToString()); GetPlayer()->ResetMap(); GetPlayer()->SetMap(oldMap); GetPlayer()->GetMap()->AddPlayerToMap(GetPlayer()); GetPlayer()->TeleportTo(GetPlayer()->m_homebindMapId, GetPlayer()->m_homebindX, GetPlayer()->m_homebindY, GetPlayer()->m_homebindZ, GetPlayer()->m_homebindO); return; }

暂时性解决了一下这个问题.