Skip to content

Commit e944605

Browse files
authored
fix(Core/SotA): stuck-in-combat after damaging cannons/demolishers (azerothcore#25905)
Co-authored-by: blinkysc <blinkysc@users.noreply.github.com>
1 parent 169e31f commit e944605

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -703,13 +703,21 @@ void BattlegroundSA::OverrideGunFaction()
703703
for (uint8 i = BG_SA_GUN_1; i <= BG_SA_GUN_10; i++)
704704
{
705705
if (Creature* gun = GetBGCreature(i))
706+
{
706707
gun->SetFaction(BG_SA_Factions[Attackers ? TEAM_ALLIANCE : TEAM_HORDE]);
708+
// NullCreatureAI never evades and PvE combat refs have no timer,
709+
// so attackers would stay in combat until death after damaging it.
710+
gun->SetIsCombatDisallowed(true);
711+
}
707712
}
708713

709714
for (uint8 i = BG_SA_DEMOLISHER_1; i <= BG_SA_DEMOLISHER_4; i++)
710715
{
711716
if (Creature* dem = GetBGCreature(i))
717+
{
712718
dem->SetFaction(BG_SA_Factions[Attackers]);
719+
dem->SetIsCombatDisallowed(true);
720+
}
713721
}
714722
}
715723

@@ -968,7 +976,10 @@ void BattlegroundSA::CaptureGraveyard(BG_SA_Graveyards i, Player* Source)
968976
BG_SA_NpcSpawnlocs[j][2], BG_SA_NpcSpawnlocs[j][3], 600);
969977

970978
if (Creature* dem = GetBGCreature(j))
979+
{
971980
dem->SetFaction(BG_SA_Factions[Attackers]);
981+
dem->SetIsCombatDisallowed(true);
982+
}
972983
}
973984

974985
UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_LEFT_GY_ALLIANCE, (GraveyardStatus[i] == TEAM_ALLIANCE ? 1 : 0));
@@ -999,7 +1010,10 @@ void BattlegroundSA::CaptureGraveyard(BG_SA_Graveyards i, Player* Source)
9991010
BG_SA_NpcSpawnlocs[j][2], BG_SA_NpcSpawnlocs[j][3], 600);
10001011

10011012
if (Creature* dem = GetBGCreature(j))
1013+
{
10021014
dem->SetFaction(BG_SA_Factions[Attackers]);
1015+
dem->SetIsCombatDisallowed(true);
1016+
}
10031017
}
10041018

10051019
UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_RIGHT_GY_ALLIANCE, (GraveyardStatus[i] == TEAM_ALLIANCE ? 1 : 0));

0 commit comments

Comments
 (0)