diff options
| author | Jeremy <Golrag@users.noreply.github.com> | 2023-12-29 14:12:15 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-29 14:12:15 +0100 |
| commit | 1ef0c045202a6af33fb991f2ff765fa183ce976f (patch) | |
| tree | 4a2744ed72b4e66935341c4d1ee3b01e5d80f0e1 /src/server/scripts | |
| parent | fb64d7fe8efe5ecba40123cdc96195d3ca52d7c0 (diff) | |
Core/Battlegrounds: Clean up some Team/TeamId parameters to use enums instead of raw integer types (#29535)
* Fix criteria data type bg loss team score
Diffstat (limited to 'src/server/scripts')
| -rw-r--r-- | src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp | 4 | ||||
| -rw-r--r-- | src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp | 6 | ||||
| -rw-r--r-- | src/server/scripts/OutdoorPvP/OutdoorPvPNA.h | 6 | ||||
| -rw-r--r-- | src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp | 2 | ||||
| -rw-r--r-- | src/server/scripts/OutdoorPvP/OutdoorPvPSI.h | 2 | ||||
| -rw-r--r-- | src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp | 4 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_quest.cpp | 2 |
7 files changed, 14 insertions, 12 deletions
diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp index 311ea43f84d..65f145154b9 100644 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp @@ -246,7 +246,7 @@ void HPControlZoneHandler::HandleProgressEventHorde(GameObject* controlZone) if (GuidUnorderedSet const* guidSet = controlZone->GetInsidePlayers()) for (ObjectGuid const& guid : *guidSet) if (Player* player = ObjectAccessor::GetPlayer(*controlZone, guid)) - if (player->GetTeam() == TEAM_HORDE) + if (player->GetTeam() == HORDE) player->KilledMonsterCredit(_killCredit); } @@ -268,7 +268,7 @@ void HPControlZoneHandler::HandleProgressEventAlliance(GameObject* controlZone) if (GuidUnorderedSet const* guidSet = controlZone->GetInsidePlayers()) for (ObjectGuid const& guid : *guidSet) if (Player* player = ObjectAccessor::GetPlayer(*controlZone, guid)) - if (player->GetTeam() == TEAM_ALLIANCE) + if (player->GetTeam() == ALLIANCE) player->KilledMonsterCredit(_killCredit); } diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp index 4453d9435cf..225c039a931 100644 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp @@ -164,12 +164,12 @@ uint32 OPvPCapturePointNA::GetAliveGuardsCount() const return std::count_if(guards.begin(), guards.end(), [](WorldObject* guard) { return guard->IsUnit() && guard->ToUnit()->IsAlive(); }); } -uint32 OPvPCapturePointNA::GetControllingFaction() const +Team OPvPCapturePointNA::GetControllingFaction() const { return m_ControllingFaction; } -void OPvPCapturePointNA::FactionTakeOver(uint32 team) +void OPvPCapturePointNA::FactionTakeOver(Team team) { m_ControllingFaction = team; m_GuardsAlive = NA_GUARDS_MAX; @@ -207,7 +207,7 @@ void OPvPCapturePointNA::FactionTakeOver(uint32 team) UpdateWyvernRoostWorldState(NA_ROOST_E); } -OPvPCapturePointNA::OPvPCapturePointNA(OutdoorPvP* pvp) : OPvPCapturePoint(pvp), m_capturable(true), m_GuardsAlive(0), m_ControllingFaction(0), m_WyvernStateNorth(0), m_WyvernStateSouth(0), m_WyvernStateEast(0), +OPvPCapturePointNA::OPvPCapturePointNA(OutdoorPvP* pvp) : OPvPCapturePoint(pvp), m_capturable(true), m_GuardsAlive(0), m_ControllingFaction(TEAM_OTHER), m_WyvernStateNorth(0), m_WyvernStateSouth(0), m_WyvernStateEast(0), m_WyvernStateWest(0), m_RespawnTimer(NA_RESPAWN_TIME), m_GuardCheckTimer(NA_GUARD_CHECK_TIME) { diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPNA.h b/src/server/scripts/OutdoorPvP/OutdoorPvPNA.h index 60c3e1f1c16..9be2cb3fdba 100644 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPNA.h +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPNA.h @@ -158,15 +158,15 @@ class OPvPCapturePointNA : public OPvPCapturePoint int32 HandleOpenGo(Player* player, GameObject* go) override; uint32 GetAliveGuardsCount() const; - uint32 GetControllingFaction() const; - void FactionTakeOver(uint32 team); // called when a faction takes control + Team GetControllingFaction() const; + void FactionTakeOver(Team team); // called when a faction takes control void UpdateWyvernRoostWorldState(uint32 roost); void SetControlZoneGUID(ObjectGuid guid) { _controlZoneGUID = guid; } private: bool m_capturable; uint32 m_GuardsAlive; - uint32 m_ControllingFaction; + Team m_ControllingFaction; uint32 m_WyvernStateNorth; uint32 m_WyvernStateSouth; uint32 m_WyvernStateEast; diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp index d652f9f8689..eec207ecba8 100644 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp @@ -40,7 +40,7 @@ uint32 const OutdoorPvPSIBuffZones[OutdoorPvPSIBuffZonesNum] = { 1377, 3428, 342 OutdoorPvPSI::OutdoorPvPSI(Map* map) : OutdoorPvP(map) { m_TypeId = OUTDOOR_PVP_SI; - m_LastController = 0; + m_LastController = TEAM_OTHER; } void OutdoorPvPSI::SendRemoveWorldStates(Player* player) diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPSI.h b/src/server/scripts/OutdoorPvP/OutdoorPvPSI.h index 1c3630e42f5..30c94b19afb 100644 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPSI.h +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPSI.h @@ -50,7 +50,7 @@ class OutdoorPvPSI : public OutdoorPvP bool HandleCustomSpell(Player* player, uint32 spellId, GameObject* go) override; private: - uint32 m_LastController; + Team m_LastController; }; #endif diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp index dcc918ebc31..1da65a99b63 100644 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp @@ -276,7 +276,7 @@ void TFControlZoneHandler::HandleProgressEventHorde(GameObject* controlZone) if (GuidUnorderedSet const* guidSet = controlZone->GetInsidePlayers()) for (ObjectGuid const& guid : *guidSet) if (Player* player = ObjectAccessor::GetPlayer(*controlZone, guid)) - if (player->GetTeam() == TEAM_HORDE) + if (player->GetTeam() == HORDE) player->AreaExploredOrEventHappens(TF_HORDE_QUEST); OutdoorPvPControlZoneHandler::HandleProgressEventHorde(controlZone); @@ -294,7 +294,7 @@ void TFControlZoneHandler::HandleProgressEventAlliance(GameObject* controlZone) if (GuidUnorderedSet const* guidSet = controlZone->GetInsidePlayers()) for (ObjectGuid const& guid : *guidSet) if (Player* player = ObjectAccessor::GetPlayer(*controlZone, guid)) - if (player->GetTeam() == TEAM_ALLIANCE) + if (player->GetTeam() == ALLIANCE) player->AreaExploredOrEventHappens(TF_ALLY_QUEST); OutdoorPvPControlZoneHandler::HandleProgressEventAlliance(controlZone); diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index a3ed5250767..7430a50d374 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -149,6 +149,8 @@ class spell_q6124_6129_apply_salve : public SpellScript if (creatureTarget->GetEntry() == NPC_SICKLY_DEER) newEntry = NPC_CURED_DEER; break; + default: + break; } if (newEntry) { |
