[7632] more "if"-condition related codestyle in battlegroundfiles Author: balrok,Triply
this time with this regex:
sed -i 's/if *( *\(.*\) *)$/if (\1)/' BattleGround*
--HG--
branch : trunk
This commit is contained in:
+59
-59
@@ -59,10 +59,10 @@ void BattleGroundEY::Update(uint32 diff)
|
||||
{
|
||||
BattleGround::Update(diff);
|
||||
|
||||
if( GetStatus() == STATUS_IN_PROGRESS )
|
||||
if (GetStatus() == STATUS_IN_PROGRESS)
|
||||
{
|
||||
m_PointAddingTimer -= diff;
|
||||
if(m_PointAddingTimer <= 0)
|
||||
if (m_PointAddingTimer <= 0)
|
||||
{
|
||||
m_PointAddingTimer = BG_EY_FPOINTS_TICK_TIME;
|
||||
if (m_TeamPointsCount[BG_TEAM_ALLIANCE] > 0)
|
||||
@@ -71,11 +71,11 @@ void BattleGroundEY::Update(uint32 diff)
|
||||
AddPoints(HORDE, BG_EY_TickPoints[m_TeamPointsCount[BG_TEAM_HORDE] - 1]);
|
||||
}
|
||||
|
||||
if(m_FlagState == BG_EY_FLAG_STATE_WAIT_RESPAWN || m_FlagState == BG_EY_FLAG_STATE_ON_GROUND)
|
||||
if (m_FlagState == BG_EY_FLAG_STATE_WAIT_RESPAWN || m_FlagState == BG_EY_FLAG_STATE_ON_GROUND)
|
||||
{
|
||||
m_FlagsTimer -= diff;
|
||||
|
||||
if(m_FlagsTimer < 0)
|
||||
if (m_FlagsTimer < 0)
|
||||
{
|
||||
m_FlagsTimer = 0;
|
||||
if (m_FlagState == BG_EY_FLAG_STATE_WAIT_RESPAWN)
|
||||
@@ -86,7 +86,7 @@ void BattleGroundEY::Update(uint32 diff)
|
||||
}
|
||||
|
||||
m_TowerCapCheckTimer -= diff;
|
||||
if(m_TowerCapCheckTimer <= 0)
|
||||
if (m_TowerCapCheckTimer <= 0)
|
||||
{
|
||||
//check if player joined point
|
||||
/*I used this order of calls, because although we will check if one player is in gameobject's distance 2 times
|
||||
@@ -150,7 +150,7 @@ void BattleGroundEY::CheckSomeoneJoinedPoint()
|
||||
while (j < m_PlayersNearPoint[EY_POINTS_MAX].size())
|
||||
{
|
||||
Player *plr = objmgr.GetPlayer(m_PlayersNearPoint[EY_POINTS_MAX][j]);
|
||||
if(!plr)
|
||||
if (!plr)
|
||||
{
|
||||
sLog.outError("BattleGroundEY: Player " I64FMTD " not found!", m_PlayersNearPoint[EY_POINTS_MAX][j]);
|
||||
++j;
|
||||
@@ -184,7 +184,7 @@ void BattleGroundEY::CheckSomeoneLeftPoint()
|
||||
for(uint8 i = 0; i < EY_POINTS_MAX; ++i)
|
||||
{
|
||||
obj = HashMapHolder<GameObject>::Find(m_BgObjects[BG_EY_OBJECT_TOWER_CAP_FEL_REALVER + i]);
|
||||
if(obj)
|
||||
if (obj)
|
||||
{
|
||||
uint8 j = 0;
|
||||
while (j < m_PlayersNearPoint[i].size())
|
||||
@@ -268,9 +268,9 @@ void BattleGroundEY::UpdateTeamScore(uint32 Team)
|
||||
{
|
||||
uint32 score = GetTeamScore(Team);
|
||||
//TODO there should be some sound played when one team is near victory!! - and define variables
|
||||
/*if( !m_IsInformedNearVictory && score >= BG_EY_WARNING_NEAR_VICTORY_SCORE )
|
||||
/*if (!m_IsInformedNearVictory && score >= BG_EY_WARNING_NEAR_VICTORY_SCORE)
|
||||
{
|
||||
if( Team == ALLIANCE )
|
||||
if (Team == ALLIANCE)
|
||||
SendMessageToAll(LANG_BG_EY_A_NEAR_VICTORY, CHAT_MSG_BG_SYSTEM_NEUTRAL);
|
||||
else
|
||||
SendMessageToAll(LANG_BG_EY_H_NEAR_VICTORY, CHAT_MSG_BG_SYSTEM_NEUTRAL);
|
||||
@@ -278,13 +278,13 @@ void BattleGroundEY::UpdateTeamScore(uint32 Team)
|
||||
m_IsInformedNearVictory = true;
|
||||
}*/
|
||||
|
||||
if( score >= BG_EY_MAX_TEAM_SCORE )
|
||||
if (score >= BG_EY_MAX_TEAM_SCORE)
|
||||
{
|
||||
score = BG_EY_MAX_TEAM_SCORE;
|
||||
EndBattleGround(Team);
|
||||
}
|
||||
|
||||
if(Team == ALLIANCE)
|
||||
if (Team == ALLIANCE)
|
||||
UpdateWorldState(EY_ALLIANCE_RESOURCES, score);
|
||||
else
|
||||
UpdateWorldState(EY_HORDE_RESOURCES, score);
|
||||
@@ -293,9 +293,9 @@ void BattleGroundEY::UpdateTeamScore(uint32 Team)
|
||||
void BattleGroundEY::EndBattleGround(uint32 winner)
|
||||
{
|
||||
//win reward
|
||||
if( winner == ALLIANCE )
|
||||
if (winner == ALLIANCE)
|
||||
RewardHonorToTeam(GetBonusHonorFromKill(1), ALLIANCE);
|
||||
if( winner == HORDE )
|
||||
if (winner == HORDE)
|
||||
RewardHonorToTeam(GetBonusHonorFromKill(1), HORDE);
|
||||
//complete map reward
|
||||
RewardHonorToTeam(GetBonusHonorFromKill(1), ALLIANCE);
|
||||
@@ -306,7 +306,7 @@ void BattleGroundEY::EndBattleGround(uint32 winner)
|
||||
|
||||
void BattleGroundEY::UpdatePointsCount(uint32 Team)
|
||||
{
|
||||
if(Team == ALLIANCE)
|
||||
if (Team == ALLIANCE)
|
||||
UpdateWorldState(EY_ALLIANCE_BASE, m_TeamPointsCount[BG_TEAM_ALLIANCE]);
|
||||
else
|
||||
UpdateWorldState(EY_HORDE_BASE, m_TeamPointsCount[BG_TEAM_HORDE]);
|
||||
@@ -318,14 +318,14 @@ void BattleGroundEY::UpdatePointsIcons(uint32 Team, uint32 Point)
|
||||
if (m_PointState[Point] == EY_POINT_UNDER_CONTROL)
|
||||
{
|
||||
UpdateWorldState(m_PointsIconStruct[Point].WorldStateControlIndex, 0);
|
||||
if(Team == ALLIANCE)
|
||||
if (Team == ALLIANCE)
|
||||
UpdateWorldState(m_PointsIconStruct[Point].WorldStateAllianceControlledIndex, 1);
|
||||
else
|
||||
UpdateWorldState(m_PointsIconStruct[Point].WorldStateHordeControlledIndex, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(Team == ALLIANCE)
|
||||
if (Team == ALLIANCE)
|
||||
UpdateWorldState(m_PointsIconStruct[Point].WorldStateAllianceControlledIndex, 0);
|
||||
else
|
||||
UpdateWorldState(m_PointsIconStruct[Point].WorldStateHordeControlledIndex, 0);
|
||||
@@ -350,15 +350,15 @@ void BattleGroundEY::RemovePlayer(Player *plr, uint64 guid)
|
||||
for (int j = EY_POINTS_MAX; j >= 0; --j)
|
||||
{
|
||||
for(int i = 0; i < m_PlayersNearPoint[j].size(); ++i)
|
||||
if(m_PlayersNearPoint[j][i] == guid)
|
||||
if (m_PlayersNearPoint[j][i] == guid)
|
||||
m_PlayersNearPoint[j].erase(m_PlayersNearPoint[j].begin() + i);
|
||||
}
|
||||
if(IsFlagPickedup())
|
||||
if (IsFlagPickedup())
|
||||
{
|
||||
if(m_FlagKeeper == guid)
|
||||
if (m_FlagKeeper == guid)
|
||||
{
|
||||
if(plr)
|
||||
this->EventPlayerDroppedFlag(plr);
|
||||
if (plr)
|
||||
EventPlayerDroppedFlag(plr);
|
||||
else
|
||||
{
|
||||
SetFlagPicker(0);
|
||||
@@ -370,7 +370,7 @@ void BattleGroundEY::RemovePlayer(Player *plr, uint64 guid)
|
||||
|
||||
void BattleGroundEY::HandleAreaTrigger(Player *Source, uint32 Trigger)
|
||||
{
|
||||
if(GetStatus() != STATUS_IN_PROGRESS)
|
||||
if (GetStatus() != STATUS_IN_PROGRESS)
|
||||
return;
|
||||
|
||||
if(!Source->isAlive()) //hack code, must be removed later
|
||||
@@ -379,23 +379,23 @@ void BattleGroundEY::HandleAreaTrigger(Player *Source, uint32 Trigger)
|
||||
switch(Trigger)
|
||||
{
|
||||
case TR_BLOOD_ELF_POINT:
|
||||
if(m_PointState[BLOOD_ELF] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[BLOOD_ELF] == Source->GetTeam())
|
||||
if(m_FlagState && GetFlagPickerGUID() == Source->GetGUID())
|
||||
if (m_PointState[BLOOD_ELF] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[BLOOD_ELF] == Source->GetTeam())
|
||||
if (m_FlagState && GetFlagPickerGUID() == Source->GetGUID())
|
||||
EventPlayerCapturedFlag(Source, BG_EY_OBJECT_FLAG_BLOOD_ELF);
|
||||
break;
|
||||
case TR_FEL_REALVER_POINT:
|
||||
if(m_PointState[FEL_REALVER] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[FEL_REALVER] == Source->GetTeam())
|
||||
if(m_FlagState && GetFlagPickerGUID() == Source->GetGUID())
|
||||
if (m_PointState[FEL_REALVER] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[FEL_REALVER] == Source->GetTeam())
|
||||
if (m_FlagState && GetFlagPickerGUID() == Source->GetGUID())
|
||||
EventPlayerCapturedFlag(Source, BG_EY_OBJECT_FLAG_FEL_REALVER);
|
||||
break;
|
||||
case TR_MAGE_TOWER_POINT:
|
||||
if(m_PointState[MAGE_TOWER] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[MAGE_TOWER] == Source->GetTeam())
|
||||
if(m_FlagState && GetFlagPickerGUID() == Source->GetGUID())
|
||||
if (m_PointState[MAGE_TOWER] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[MAGE_TOWER] == Source->GetTeam())
|
||||
if (m_FlagState && GetFlagPickerGUID() == Source->GetGUID())
|
||||
EventPlayerCapturedFlag(Source, BG_EY_OBJECT_FLAG_MAGE_TOWER);
|
||||
break;
|
||||
case TR_DRAENEI_RUINS_POINT:
|
||||
if(m_PointState[DRAENEI_RUINS] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[DRAENEI_RUINS] == Source->GetTeam())
|
||||
if(m_FlagState && GetFlagPickerGUID() == Source->GetGUID())
|
||||
if (m_PointState[DRAENEI_RUINS] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[DRAENEI_RUINS] == Source->GetTeam())
|
||||
if (m_FlagState && GetFlagPickerGUID() == Source->GetGUID())
|
||||
EventPlayerCapturedFlag(Source, BG_EY_OBJECT_FLAG_DRAENEI_RUINS);
|
||||
break;
|
||||
case 4512:
|
||||
@@ -419,7 +419,7 @@ void BattleGroundEY::HandleAreaTrigger(Player *Source, uint32 Trigger)
|
||||
bool BattleGroundEY::SetupBattleGround()
|
||||
{
|
||||
// doors
|
||||
if( !AddObject(BG_EY_OBJECT_DOOR_A, BG_OBJECT_A_DOOR_EY_ENTRY, 2527.6f, 1596.91f, 1262.13f, -3.12414f, -0.173642f, -0.001515f, 0.98477f, -0.008594f, RESPAWN_IMMEDIATELY)
|
||||
if (!AddObject(BG_EY_OBJECT_DOOR_A, BG_OBJECT_A_DOOR_EY_ENTRY, 2527.6f, 1596.91f, 1262.13f, -3.12414f, -0.173642f, -0.001515f, 0.98477f, -0.008594f, RESPAWN_IMMEDIATELY)
|
||||
|| !AddObject(BG_EY_OBJECT_DOOR_H, BG_OBJECT_H_DOOR_EY_ENTRY, 1803.21f, 1539.49f, 1261.09f, 3.14159f, 0.173648f, 0, 0.984808f, 0, RESPAWN_IMMEDIATELY)
|
||||
// banners (alliance)
|
||||
|| !AddObject(BG_EY_OBJECT_A_BANNER_FEL_REALVER_CENTER, BG_OBJECT_A_BANNER_EY_ENTRY, 2057.46f, 1735.07f, 1187.91f, -0.925024f, 0, 0, 0.446198f, -0.894934f, RESPAWN_ONE_DAY)
|
||||
@@ -481,12 +481,12 @@ bool BattleGroundEY::SetupBattleGround()
|
||||
for (int i = 0; i < EY_POINTS_MAX; ++i)
|
||||
{
|
||||
AreaTriggerEntry const* at = sAreaTriggerStore.LookupEntry(m_Points_Trigger[i]);
|
||||
if( !at )
|
||||
if (!at)
|
||||
{
|
||||
sLog.outError("BattleGroundEY: Unknown trigger: %u", m_Points_Trigger[i]);
|
||||
continue;
|
||||
}
|
||||
if ( !AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REALVER + i * 3, Buff_Entries[0], at->x, at->y, at->z, 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY)
|
||||
if (!AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REALVER + i * 3, Buff_Entries[0], at->x, at->y, at->z, 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY)
|
||||
|| !AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REALVER + i * 3 + 1, Buff_Entries[1], at->x, at->y, at->z, 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY)
|
||||
|| !AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REALVER + i * 3 + 2, Buff_Entries[2], at->x, at->y, at->z, 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY)
|
||||
)
|
||||
@@ -495,14 +495,14 @@ bool BattleGroundEY::SetupBattleGround()
|
||||
|
||||
WorldSafeLocsEntry const *sg = NULL;
|
||||
sg = sWorldSafeLocsStore.LookupEntry(EY_GRAVEYARD_MAIN_ALLIANCE);
|
||||
if( !sg || !AddSpiritGuide(EY_SPIRIT_MAIN_ALLIANCE, sg->x, sg->y, sg->z, 3.124139f, ALLIANCE) )
|
||||
if (!sg || !AddSpiritGuide(EY_SPIRIT_MAIN_ALLIANCE, sg->x, sg->y, sg->z, 3.124139f, ALLIANCE))
|
||||
{
|
||||
sLog.outErrorDb("BatteGroundEY: Failed to spawn spirit guide! BattleGround not created!");
|
||||
return false;
|
||||
}
|
||||
|
||||
sg = sWorldSafeLocsStore.LookupEntry(EY_GRAVEYARD_MAIN_HORDE);
|
||||
if( !sg || !AddSpiritGuide(EY_SPIRIT_MAIN_HORDE, sg->x, sg->y, sg->z, 3.193953f, HORDE) )
|
||||
if (!sg || !AddSpiritGuide(EY_SPIRIT_MAIN_HORDE, sg->x, sg->y, sg->z, 3.193953f, HORDE))
|
||||
{
|
||||
sLog.outErrorDb("BatteGroundEY: Failed to spawn spirit guide! BattleGround not created!");
|
||||
return false;
|
||||
@@ -552,7 +552,7 @@ void BattleGroundEY::RespawnFlag(bool send_message)
|
||||
m_FlagState = BG_EY_FLAG_STATE_ON_BASE;
|
||||
SpawnBGObject(BG_EY_OBJECT_FLAG_NETHERSTORM, RESPAWN_IMMEDIATELY);
|
||||
|
||||
if(send_message)
|
||||
if (send_message)
|
||||
{
|
||||
SendMessageToAll(LANG_BG_EY_RESETED_FLAG, CHAT_MSG_BG_SYSTEM_NEUTRAL);
|
||||
PlaySoundToAll(BG_EY_SOUND_FLAG_RESET); // flags respawned sound...
|
||||
@@ -566,7 +566,7 @@ void BattleGroundEY::RespawnFlagAfterDrop()
|
||||
RespawnFlag(true);
|
||||
|
||||
GameObject *obj = HashMapHolder<GameObject>::Find(GetDroppedFlagGUID());
|
||||
if(obj)
|
||||
if (obj)
|
||||
obj->Delete();
|
||||
else
|
||||
sLog.outError("BattleGroundEY: Unknown dropped flag guid: %u",GUID_LOPART(GetDroppedFlagGUID()));
|
||||
@@ -576,7 +576,7 @@ void BattleGroundEY::RespawnFlagAfterDrop()
|
||||
|
||||
void BattleGroundEY::HandleKillPlayer(Player *player, Player *killer)
|
||||
{
|
||||
if(GetStatus() != STATUS_IN_PROGRESS)
|
||||
if (GetStatus() != STATUS_IN_PROGRESS)
|
||||
return;
|
||||
|
||||
BattleGround::HandleKillPlayer(player, killer);
|
||||
@@ -585,11 +585,11 @@ void BattleGroundEY::HandleKillPlayer(Player *player, Player *killer)
|
||||
|
||||
void BattleGroundEY::EventPlayerDroppedFlag(Player *Source)
|
||||
{
|
||||
if(GetStatus() != STATUS_IN_PROGRESS)
|
||||
if (GetStatus() != STATUS_IN_PROGRESS)
|
||||
{
|
||||
// if not running, do not cast things at the dropper player, neither send unnecessary messages
|
||||
// just take off the aura
|
||||
if(IsFlagPickedup() && GetFlagPickerGUID() == Source->GetGUID())
|
||||
if (IsFlagPickedup() && GetFlagPickerGUID() == Source->GetGUID())
|
||||
{
|
||||
SetFlagPicker(0);
|
||||
Source->RemoveAurasDueToSpell(BG_EY_NETHERSTORM_FLAG_SPELL);
|
||||
@@ -597,10 +597,10 @@ void BattleGroundEY::EventPlayerDroppedFlag(Player *Source)
|
||||
return;
|
||||
}
|
||||
|
||||
if(!IsFlagPickedup())
|
||||
if (!IsFlagPickedup())
|
||||
return;
|
||||
|
||||
if(GetFlagPickerGUID() != Source->GetGUID())
|
||||
if (GetFlagPickerGUID() != Source->GetGUID())
|
||||
return;
|
||||
|
||||
SetFlagPicker(0);
|
||||
@@ -613,7 +613,7 @@ void BattleGroundEY::EventPlayerDroppedFlag(Player *Source)
|
||||
UpdateWorldState(NETHERSTORM_FLAG_STATE_HORDE, BG_EY_FLAG_STATE_WAIT_RESPAWN);
|
||||
UpdateWorldState(NETHERSTORM_FLAG_STATE_ALLIANCE, BG_EY_FLAG_STATE_WAIT_RESPAWN);
|
||||
|
||||
if(Source->GetTeam() == ALLIANCE)
|
||||
if (Source->GetTeam() == ALLIANCE)
|
||||
SendMessageToAll(LANG_BG_EY_DROPPED_FLAG, CHAT_MSG_BG_SYSTEM_ALLIANCE, NULL);
|
||||
else
|
||||
SendMessageToAll(LANG_BG_EY_DROPPED_FLAG, CHAT_MSG_BG_SYSTEM_HORDE, NULL);
|
||||
@@ -621,10 +621,10 @@ void BattleGroundEY::EventPlayerDroppedFlag(Player *Source)
|
||||
|
||||
void BattleGroundEY::EventPlayerClickedOnFlag(Player *Source, GameObject* target_obj)
|
||||
{
|
||||
if(GetStatus() != STATUS_IN_PROGRESS || this->IsFlagPickedup() || !Source->IsWithinDistInMap(target_obj, 10))
|
||||
if (GetStatus() != STATUS_IN_PROGRESS || IsFlagPickedup() || !Source->IsWithinDistInMap(target_obj, 10))
|
||||
return;
|
||||
|
||||
if(Source->GetTeam() == ALLIANCE)
|
||||
if (Source->GetTeam() == ALLIANCE)
|
||||
{
|
||||
UpdateWorldState(NETHERSTORM_FLAG_STATE_ALLIANCE, BG_EY_FLAG_STATE_ON_PLAYER);
|
||||
PlaySoundToAll(BG_EY_SOUND_FLAG_PICKED_UP_ALLIANCE);
|
||||
@@ -645,7 +645,7 @@ void BattleGroundEY::EventPlayerClickedOnFlag(Player *Source, GameObject* target
|
||||
Source->CastSpell(Source, BG_EY_NETHERSTORM_FLAG_SPELL, true);
|
||||
Source->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT);
|
||||
|
||||
if(Source->GetTeam() == ALLIANCE)
|
||||
if (Source->GetTeam() == ALLIANCE)
|
||||
PSendMessageToAll(LANG_BG_EY_HAS_TAKEN_FLAG, CHAT_MSG_BG_SYSTEM_ALLIANCE, NULL, Source->GetName());
|
||||
else
|
||||
PSendMessageToAll(LANG_BG_EY_HAS_TAKEN_FLAG, CHAT_MSG_BG_SYSTEM_HORDE, NULL, Source->GetName());
|
||||
@@ -653,13 +653,13 @@ void BattleGroundEY::EventPlayerClickedOnFlag(Player *Source, GameObject* target
|
||||
|
||||
void BattleGroundEY::EventTeamLostPoint(Player *Source, uint32 Point)
|
||||
{
|
||||
if(GetStatus() != STATUS_IN_PROGRESS)
|
||||
if (GetStatus() != STATUS_IN_PROGRESS)
|
||||
return;
|
||||
|
||||
//Natural point
|
||||
uint32 Team = m_PointOwnedByTeam[Point];
|
||||
|
||||
if(!Team)
|
||||
if (!Team)
|
||||
return;
|
||||
|
||||
if (Team == ALLIANCE)
|
||||
@@ -697,7 +697,7 @@ void BattleGroundEY::EventTeamLostPoint(Player *Source, uint32 Point)
|
||||
|
||||
void BattleGroundEY::EventTeamCapturedPoint(Player *Source, uint32 Point)
|
||||
{
|
||||
if(GetStatus() != STATUS_IN_PROGRESS)
|
||||
if (GetStatus() != STATUS_IN_PROGRESS)
|
||||
return;
|
||||
|
||||
uint32 Team = Source->GetTeam();
|
||||
@@ -731,12 +731,12 @@ void BattleGroundEY::EventTeamCapturedPoint(Player *Source, uint32 Point)
|
||||
else
|
||||
SendMessageToAll(m_CapturingPointTypes[Point].MessageIdHorde,CHAT_MSG_BG_SYSTEM_HORDE, Source);
|
||||
|
||||
if(m_BgCreatures[Point])
|
||||
if (m_BgCreatures[Point])
|
||||
DelCreature(Point);
|
||||
|
||||
WorldSafeLocsEntry const *sg = NULL;
|
||||
sg = sWorldSafeLocsStore.LookupEntry(m_CapturingPointTypes[Point].GraveYardId);
|
||||
if(!sg || !AddSpiritGuide(Point, sg->x, sg->y, sg->z, 3.124139f, Team))
|
||||
if (!sg || !AddSpiritGuide(Point, sg->x, sg->y, sg->z, 3.124139f, Team))
|
||||
sLog.outError("BatteGroundEY: Failed to spawn spirit guide! point: %u, team: %u, graveyard_id: %u",
|
||||
Point, Team, m_CapturingPointTypes[Point].GraveYardId);
|
||||
|
||||
@@ -748,7 +748,7 @@ void BattleGroundEY::EventTeamCapturedPoint(Player *Source, uint32 Point)
|
||||
|
||||
void BattleGroundEY::EventPlayerCapturedFlag(Player *Source, uint32 BgObjectType)
|
||||
{
|
||||
if(GetStatus() != STATUS_IN_PROGRESS || this->GetFlagPickerGUID() != Source->GetGUID())
|
||||
if (GetStatus() != STATUS_IN_PROGRESS || GetFlagPickerGUID() != Source->GetGUID())
|
||||
return;
|
||||
|
||||
SetFlagPicker(0);
|
||||
@@ -757,7 +757,7 @@ void BattleGroundEY::EventPlayerCapturedFlag(Player *Source, uint32 BgObjectType
|
||||
|
||||
Source->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT);
|
||||
|
||||
if(Source->GetTeam() == ALLIANCE)
|
||||
if (Source->GetTeam() == ALLIANCE)
|
||||
PlaySoundToAll(BG_EY_SOUND_FLAG_CAPTURED_ALLIANCE);
|
||||
else
|
||||
PlaySoundToAll(BG_EY_SOUND_FLAG_CAPTURED_HORDE);
|
||||
@@ -768,7 +768,7 @@ void BattleGroundEY::EventPlayerCapturedFlag(Player *Source, uint32 BgObjectType
|
||||
m_FlagCapturedBgObjectType = BgObjectType;
|
||||
|
||||
uint8 team_id = 0;
|
||||
if(Source->GetTeam() == ALLIANCE)
|
||||
if (Source->GetTeam() == ALLIANCE)
|
||||
{
|
||||
team_id = BG_TEAM_ALLIANCE;
|
||||
SendMessageToAll(LANG_BG_EY_CAPTURED_FLAG_A, CHAT_MSG_BG_SYSTEM_ALLIANCE, Source);
|
||||
@@ -779,7 +779,7 @@ void BattleGroundEY::EventPlayerCapturedFlag(Player *Source, uint32 BgObjectType
|
||||
SendMessageToAll(LANG_BG_EY_CAPTURED_FLAG_H, CHAT_MSG_BG_SYSTEM_HORDE, Source);
|
||||
}
|
||||
|
||||
if(m_TeamPointsCount[team_id] > 0)
|
||||
if (m_TeamPointsCount[team_id] > 0)
|
||||
AddPoints(Source->GetTeam(), BG_EY_FlagPoints[m_TeamPointsCount[team_id] - 1]);
|
||||
|
||||
UpdatePlayerScore(Source, SCORE_FLAG_CAPTURES, 1);
|
||||
@@ -871,7 +871,7 @@ WorldSafeLocsEntry const *BattleGroundEY::GetClosestGraveYard(Player* player)
|
||||
entry = sWorldSafeLocsStore.LookupEntry(g_id);
|
||||
nearestEntry = entry;
|
||||
|
||||
if(!entry)
|
||||
if (!entry)
|
||||
{
|
||||
sLog.outError("BattleGroundEY: Not found the main team graveyard. Graveyard system isn't working!");
|
||||
return NULL;
|
||||
@@ -887,15 +887,15 @@ WorldSafeLocsEntry const *BattleGroundEY::GetClosestGraveYard(Player* player)
|
||||
|
||||
for(uint8 i = 0; i < EY_POINTS_MAX; ++i)
|
||||
{
|
||||
if(m_PointOwnedByTeam[i]==player->GetTeam() && m_PointState[i]==EY_POINT_UNDER_CONTROL)
|
||||
if (m_PointOwnedByTeam[i]==player->GetTeam() && m_PointState[i]==EY_POINT_UNDER_CONTROL)
|
||||
{
|
||||
entry = sWorldSafeLocsStore.LookupEntry(m_CapturingPointTypes[i].GraveYardId);
|
||||
if(!entry)
|
||||
if (!entry)
|
||||
sLog.outError("BattleGroundEY: Not found graveyard: %u",m_CapturingPointTypes[i].GraveYardId);
|
||||
else
|
||||
{
|
||||
distance = (entry->x - plr_x)*(entry->x - plr_x) + (entry->y - plr_y)*(entry->y - plr_y) + (entry->z - plr_z)*(entry->z - plr_z);
|
||||
if(distance < nearestDistance)
|
||||
if (distance < nearestDistance)
|
||||
{
|
||||
nearestDistance = distance;
|
||||
nearestEntry = entry;
|
||||
|
||||
Reference in New Issue
Block a user