Merge branch 'master' into Playerbot_20250219

This commit is contained in:
Yunfan Li
2025-02-22 10:36:10 +08:00
25 changed files with 585 additions and 506 deletions

View File

@@ -2212,15 +2212,6 @@ bool InstanceMap::AddPlayerToMap(Player* player)
m_resetAfterUnload = false;
m_unloadWhenEmpty = false;
if (instance_data && instance_data->IsTwoFactionInstance()
&& instance_data->GetTeamIdInInstance() == TEAM_NEUTRAL)
{
instance_data->SetTeamIdInInstance(player->GetTeamId());
if (Group* group = player->GetGroup())
if (Player* leader = ObjectAccessor::FindConnectedPlayer(group->GetLeaderGUID()))
instance_data->SetTeamIdInInstance(leader->GetTeamId());
}
// this will acquire the same mutex so it cannot be in the previous block
Map::AddPlayerToMap(player);