Core/Battlegrounds: Clean up some Team/TeamId parameters to use enums instead of raw integer types
Port From (https://github.com/TrinityCore/TrinityCore/commit/1ef0c045202a6af33fb991f2ff765fa183ce976f)
This commit is contained in:
@@ -1623,7 +1623,7 @@ namespace Game.Entities
|
||||
// 0 1 2 3 4 5 6 7 8 9 10
|
||||
// SELECT instanceId, team, joinX, joinY, joinZ, joinO, joinMapId, taxiStart, taxiEnd, mountSpell, queueTypeId FROM character_Battleground_data WHERE guid = ?
|
||||
m_bgData.bgInstanceID = result.Read<uint>(0);
|
||||
m_bgData.bgTeam = result.Read<ushort>(1);
|
||||
m_bgData.bgTeam = (Team)result.Read<ushort>(1);
|
||||
m_bgData.joinPos = new WorldLocation(result.Read<ushort>(6), result.Read<float>(2), result.Read<float>(3), result.Read<float>(4), result.Read<float>(5));
|
||||
m_bgData.taxiPath[0] = result.Read<uint>(7);
|
||||
m_bgData.taxiPath[1] = result.Read<uint>(8);
|
||||
@@ -2784,7 +2784,7 @@ namespace Game.Entities
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_PLAYER_BGDATA);
|
||||
stmt.AddValue(0, GetGUID().GetCounter());
|
||||
stmt.AddValue(1, m_bgData.bgInstanceID);
|
||||
stmt.AddValue(2, m_bgData.bgTeam);
|
||||
stmt.AddValue(2, (ushort)m_bgData.bgTeam);
|
||||
stmt.AddValue(3, m_bgData.joinPos.GetPositionX());
|
||||
stmt.AddValue(4, m_bgData.joinPos.GetPositionY());
|
||||
stmt.AddValue(5, m_bgData.joinPos.GetPositionZ());
|
||||
|
||||
@@ -578,7 +578,7 @@ namespace Game.Entities
|
||||
public byte bgAfkReportedCount;
|
||||
public long bgAfkReportedTimer;
|
||||
|
||||
public uint bgTeam; //< What side the player will be added to
|
||||
public Team bgTeam; //< What side the player will be added to
|
||||
|
||||
public uint mountSpell;
|
||||
public uint[] taxiPath = new uint[2];
|
||||
|
||||
@@ -580,13 +580,13 @@ namespace Game.Entities
|
||||
|
||||
public void SetBGTeam(Team team)
|
||||
{
|
||||
m_bgData.bgTeam = (uint)team;
|
||||
m_bgData.bgTeam = team;
|
||||
SetArenaFaction((byte)(team == Team.Alliance ? 1 : 0));
|
||||
}
|
||||
|
||||
public Team GetBGTeam()
|
||||
{
|
||||
return m_bgData.bgTeam != 0 ? (Team)m_bgData.bgTeam : GetTeam();
|
||||
return m_bgData.bgTeam != 0 ? m_bgData.bgTeam : GetTeam();
|
||||
}
|
||||
|
||||
public void LeaveBattleground(bool teleportToEntryPoint = true)
|
||||
|
||||
@@ -5179,13 +5179,13 @@ namespace Game.Entities
|
||||
return (uint)rEntry.Alliance;
|
||||
|
||||
Log.outError(LogFilter.Player, "Race ({0}) not found in DBC: wrong DBC files?", race);
|
||||
return TeamId.Neutral;
|
||||
return BatttleGroundTeamId.Neutral;
|
||||
}
|
||||
public Team GetTeam() { return m_team; }
|
||||
public int GetTeamId() { return m_team == Team.Alliance ? TeamId.Alliance : TeamId.Horde; }
|
||||
public int GetTeamId() { return m_team == Team.Alliance ? BatttleGroundTeamId.Alliance : BatttleGroundTeamId.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; }
|
||||
public int GetEffectiveTeamId() { return GetEffectiveTeam() == Team.Alliance ? BatttleGroundTeamId.Alliance : BatttleGroundTeamId.Horde; }
|
||||
|
||||
//Money
|
||||
public ulong GetMoney() { return m_activePlayerData.Coinage; }
|
||||
|
||||
Reference in New Issue
Block a user