Core/Battlegrounds: Replaced overriding m_team with more fine grained approach

Port From (https://github.com/TrinityCore/TrinityCore/commit/55587694053583b4cb85be38a47563a9fdf77271)
This commit is contained in:
hondacrx
2022-05-31 13:45:46 -04:00
parent 014c4b9c54
commit dfee7691f7
22 changed files with 109 additions and 100 deletions
+3 -8
View File
@@ -3515,14 +3515,6 @@ namespace Game.Entities
uint GetChampioningFaction() { return m_ChampioningFaction; }
public void SetChampioningFaction(uint faction) { m_ChampioningFaction = faction; }
public void SwitchToOppositeTeam(bool apply)
{
m_team = TeamForRace(GetRace());
if (apply)
m_team = (m_team == Team.Alliance) ? Team.Horde : Team.Alliance;
}
public void SetFactionForRace(Race race)
{
@@ -5251,6 +5243,9 @@ namespace Game.Entities
public Team GetTeam() { return m_team; }
public int GetTeamId() { return m_team == Team.Alliance ? TeamId.Alliance : TeamId.Horde; }
public Team GetEffectiveTeam() { return HasPlayerFlagEx(PlayerFlagsEx.MercenaryMode) ? (GetTeam() == Team.Alliance ? Team.Horde : Team.Alliance) : GetTeam(); }
public int GetEffectiveTeamId() { return GetEffectiveTeam() == Team.Alliance ? TeamId.Alliance : TeamId.Horde; }
//Money
public ulong GetMoney() { return m_activePlayerData.Coinage; }
public bool HasEnoughMoney(ulong amount) { return GetMoney() >= amount; }