Core/Refactor: Part 4
This commit is contained in:
@@ -459,7 +459,7 @@ namespace Game.BattleGrounds.Zones
|
||||
{
|
||||
UpdatePlayerScore(source, ScoreType.BasesAssaulted, 1);
|
||||
m_prevNodes[node] = m_Nodes[node];
|
||||
m_Nodes[node] = (ABNodeStatus.Contested + (int)teamIndex);
|
||||
m_Nodes[node] = (ABNodeStatus.Contested + teamIndex);
|
||||
// burn current contested banner
|
||||
_DelBanner(node, ABNodeStatus.Contested, (byte)teamIndex);
|
||||
// create new contested banner
|
||||
@@ -477,7 +477,7 @@ namespace Game.BattleGrounds.Zones
|
||||
{
|
||||
UpdatePlayerScore(source, ScoreType.BasesDefended, 1);
|
||||
m_prevNodes[node] = m_Nodes[node];
|
||||
m_Nodes[node] = (ABNodeStatus.Occupied + (int)teamIndex);
|
||||
m_Nodes[node] = (ABNodeStatus.Occupied + teamIndex);
|
||||
// burn current contested banner
|
||||
_DelBanner(node, ABNodeStatus.Contested, (byte)teamIndex);
|
||||
// create new occupied banner
|
||||
@@ -498,7 +498,7 @@ namespace Game.BattleGrounds.Zones
|
||||
{
|
||||
UpdatePlayerScore(source, ScoreType.BasesAssaulted, 1);
|
||||
m_prevNodes[node] = m_Nodes[node];
|
||||
m_Nodes[node] = (ABNodeStatus.Contested + (int)teamIndex);
|
||||
m_Nodes[node] = (ABNodeStatus.Contested + teamIndex);
|
||||
// burn current occupied banner
|
||||
_DelBanner(node, ABNodeStatus.Occupied, (byte)teamIndex);
|
||||
// create new contested banner
|
||||
@@ -639,7 +639,7 @@ namespace Game.BattleGrounds.Zones
|
||||
// Is there any occupied node for this team?
|
||||
List<byte> nodes = new List<byte>();
|
||||
for (byte i = 0; i < ABBattlegroundNodes.DynamicNodesCount; ++i)
|
||||
if (m_Nodes[i] == ABNodeStatus.Occupied + (int)teamIndex)
|
||||
if (m_Nodes[i] == ABNodeStatus.Occupied + teamIndex)
|
||||
nodes.Add(i);
|
||||
|
||||
WorldSafeLocsRecord good_entry = null;
|
||||
|
||||
@@ -125,7 +125,7 @@ namespace Game.BattleGrounds.Zones
|
||||
SpawnBGObject(EotSObjectTypes.DoorA, BattlegroundConst.RespawnImmediately);
|
||||
SpawnBGObject(EotSObjectTypes.DoorH, BattlegroundConst.RespawnImmediately);
|
||||
|
||||
for (int i = (int)EotSObjectTypes.ABannerFelReaverCenter; i < EotSObjectTypes.Max; ++i)
|
||||
for (int i = EotSObjectTypes.ABannerFelReaverCenter; i < EotSObjectTypes.Max; ++i)
|
||||
SpawnBGObject(i, BattlegroundConst.RespawnOneDay);
|
||||
}
|
||||
|
||||
@@ -884,8 +884,6 @@ namespace Game.BattleGrounds.Zones
|
||||
default: return null;
|
||||
}
|
||||
|
||||
float distance, nearestDistance;
|
||||
|
||||
WorldSafeLocsRecord entry = null;
|
||||
WorldSafeLocsRecord nearestEntry = null;
|
||||
entry = CliDB.WorldSafeLocsStorage.LookupByKey(g_id);
|
||||
@@ -901,8 +899,8 @@ namespace Game.BattleGrounds.Zones
|
||||
float plr_y = player.GetPositionY();
|
||||
float plr_z = player.GetPositionZ();
|
||||
|
||||
distance = (entry.Loc.X - plr_x) * (entry.Loc.X - plr_x) + (entry.Loc.Y - plr_y) * (entry.Loc.Y - plr_y) + (entry.Loc.Z - plr_z) * (entry.Loc.Z - plr_z);
|
||||
nearestDistance = distance;
|
||||
float distance = (entry.Loc.X - plr_x) * (entry.Loc.X - plr_x) + (entry.Loc.Y - plr_y) * (entry.Loc.Y - plr_y) + (entry.Loc.Z - plr_z) * (entry.Loc.Z - plr_z);
|
||||
float nearestDistance = distance;
|
||||
|
||||
for (byte i = 0; i < EotSPoints.PointsMax; ++i)
|
||||
{
|
||||
|
||||
@@ -603,9 +603,9 @@ namespace Game.BattleGrounds.Zones
|
||||
void UpdateTeamScore(int team)
|
||||
{
|
||||
if (team == TeamId.Alliance)
|
||||
UpdateWorldState(WSGWorldStates.FlagCapturesAlliance, (uint)GetTeamScore(team));
|
||||
UpdateWorldState(WSGWorldStates.FlagCapturesAlliance, GetTeamScore(team));
|
||||
else
|
||||
UpdateWorldState(WSGWorldStates.FlagCapturesHorde, (uint)GetTeamScore(team));
|
||||
UpdateWorldState(WSGWorldStates.FlagCapturesHorde, GetTeamScore(team));
|
||||
}
|
||||
|
||||
public override void HandleAreaTrigger(Player player, uint trigger, bool entered)
|
||||
@@ -912,7 +912,7 @@ namespace Game.BattleGrounds.Zones
|
||||
void SetLastFlagCapture(Team team) { _lastFlagCaptureTeam = (uint)team; }
|
||||
public override void SetDroppedFlagGUID(ObjectGuid guid, int team = -1)
|
||||
{
|
||||
if (team == (int)TeamId.Alliance || team == (int)TeamId.Horde)
|
||||
if (team == TeamId.Alliance || team == TeamId.Horde)
|
||||
m_DroppedFlagGUID[team] = guid;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user