mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-14 16:03:45 +00:00
fix(Core/Instances): Ensure team is acquired before spawning creatures (#21221)
This commit is contained in:
@@ -57,23 +57,7 @@ void InstanceScript::SaveToDB()
|
||||
|
||||
void InstanceScript::OnPlayerEnter(Player* player)
|
||||
{
|
||||
if (!IsTwoFactionInstance())
|
||||
return;
|
||||
|
||||
if (GetTeamIdInInstance() == TEAM_NEUTRAL)
|
||||
{
|
||||
if (Group* group = player->GetGroup())
|
||||
{
|
||||
if (Player* leader = ObjectAccessor::FindConnectedPlayer(group->GetLeaderGUID()))
|
||||
_teamIdInInstance = leader->GetTeamId();
|
||||
else
|
||||
_teamIdInInstance = player->GetTeamId();
|
||||
}
|
||||
else
|
||||
_teamIdInInstance = player->GetTeamId();
|
||||
}
|
||||
|
||||
if (sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP))
|
||||
if (sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP) && IsTwoFactionInstance())
|
||||
player->SetFaction((_teamIdInInstance == TEAM_HORDE) ? 1610 /*FACTION_HORDE*/ : 1 /*FACTION_ALLIANCE*/);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user