Code style (game + scripts only):
"if(" --> "if ("
--HG--
branch : trunk
This commit is contained in:
+47
-47
@@ -75,7 +75,7 @@ bool BattleGroundSA::ResetObjs()
|
||||
|
||||
for (uint8 i = 0; i < BG_SA_CENTRAL_FLAG; i++)
|
||||
{
|
||||
if(!AddObject(i,BG_SA_ObjEntries[i],
|
||||
if (!AddObject(i,BG_SA_ObjEntries[i],
|
||||
BG_SA_ObjSpawnlocs[i][0],BG_SA_ObjSpawnlocs[i][1],
|
||||
BG_SA_ObjSpawnlocs[i][2],BG_SA_ObjSpawnlocs[i][3],
|
||||
0,0,0,0,RESPAWN_ONE_DAY))
|
||||
@@ -86,7 +86,7 @@ bool BattleGroundSA::ResetObjs()
|
||||
//By capturing GYs.
|
||||
for (uint8 i = 0; i < BG_SA_NPC_SPARKLIGHT; i++)
|
||||
{
|
||||
if(!AddCreature(BG_SA_NpcEntries[i], i, (attackers == TEAM_ALLIANCE ? TEAM_HORDE : TEAM_ALLIANCE),
|
||||
if (!AddCreature(BG_SA_NpcEntries[i], i, (attackers == TEAM_ALLIANCE ? TEAM_HORDE : TEAM_ALLIANCE),
|
||||
BG_SA_NpcSpawnlocs[i][0],BG_SA_NpcSpawnlocs[i][1],
|
||||
BG_SA_NpcSpawnlocs[i][2],BG_SA_NpcSpawnlocs[i][3]))
|
||||
return false;
|
||||
@@ -121,13 +121,13 @@ bool BattleGroundSA::ResetObjs()
|
||||
WorldSafeLocsEntry const *sg = NULL;
|
||||
sg = sWorldSafeLocsStore.LookupEntry(BG_SA_GYEntries[i]);
|
||||
|
||||
if(!sg)
|
||||
if (!sg)
|
||||
{
|
||||
sLog.outError("SOTA: Can't find GY entry %u",BG_SA_GYEntries[i]);
|
||||
return false;
|
||||
}
|
||||
|
||||
if(i == BG_SA_BEACH_GY)
|
||||
if (i == BG_SA_BEACH_GY)
|
||||
{
|
||||
GraveyardStatus[i] = attackers;
|
||||
AddSpiritGuide(i + BG_SA_MAXNPC, sg->x, sg->y, sg->z, BG_SA_GYOrientation[i], ((attackers == TEAM_HORDE )? HORDE : ALLIANCE));
|
||||
@@ -135,7 +135,7 @@ bool BattleGroundSA::ResetObjs()
|
||||
else
|
||||
{
|
||||
GraveyardStatus[i] = ((attackers == TEAM_HORDE )? TEAM_ALLIANCE : TEAM_HORDE);
|
||||
if(!AddSpiritGuide(i + BG_SA_MAXNPC, sg->x, sg->y, sg->z, BG_SA_GYOrientation[i], ((attackers == TEAM_HORDE )? ALLIANCE : HORDE) ))
|
||||
if (!AddSpiritGuide(i + BG_SA_MAXNPC, sg->x, sg->y, sg->z, BG_SA_GYOrientation[i], ((attackers == TEAM_HORDE )? ALLIANCE : HORDE) ))
|
||||
sLog.outError("SOTA: couldn't spawn GY: %u",i);
|
||||
}
|
||||
}
|
||||
@@ -159,7 +159,7 @@ bool BattleGroundSA::ResetObjs()
|
||||
UpdateWorldState(BG_SA_LEFT_GY_ALLIANCE , GraveyardStatus[BG_SA_LEFT_CAPTURABLE_GY] == TEAM_ALLIANCE?1:0 );
|
||||
UpdateWorldState(BG_SA_CENTER_GY_ALLIANCE , GraveyardStatus[BG_SA_CENTRAL_CAPTURABLE_GY] == TEAM_ALLIANCE?1:0 );
|
||||
|
||||
if(attackers == TEAM_ALLIANCE)
|
||||
if (attackers == TEAM_ALLIANCE)
|
||||
{
|
||||
UpdateWorldState(BG_SA_ALLY_ATTACKS, 1);
|
||||
UpdateWorldState(BG_SA_HORDE_ATTACKS, 0);
|
||||
@@ -199,7 +199,7 @@ bool BattleGroundSA::ResetObjs()
|
||||
|
||||
void BattleGroundSA::StartShips()
|
||||
{
|
||||
if(ShipsStarted)
|
||||
if (ShipsStarted)
|
||||
return;
|
||||
|
||||
DoorOpen(BG_SA_BOAT_ONE);
|
||||
@@ -209,9 +209,9 @@ void BattleGroundSA::StartShips()
|
||||
{
|
||||
for ( BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end();itr++)
|
||||
{
|
||||
if(Player* p = objmgr.GetPlayer(itr->first))
|
||||
if (Player* p = objmgr.GetPlayer(itr->first))
|
||||
{
|
||||
if(p->GetTeamId() != attackers)
|
||||
if (p->GetTeamId() != attackers)
|
||||
continue;
|
||||
|
||||
UpdateData data;
|
||||
@@ -230,23 +230,23 @@ void BattleGroundSA::Update(uint32 diff)
|
||||
BattleGround::Update(diff);
|
||||
TotalTime += diff;
|
||||
|
||||
if(status == BG_SA_WARMUP || status == BG_SA_SECOND_WARMUP)
|
||||
if (status == BG_SA_WARMUP || status == BG_SA_SECOND_WARMUP)
|
||||
{
|
||||
if(TotalTime >= BG_SA_WARMUPLENGTH)
|
||||
if (TotalTime >= BG_SA_WARMUPLENGTH)
|
||||
{
|
||||
TotalTime = 0;
|
||||
ToggleTimer();
|
||||
status = (status == BG_SA_WARMUP) ? BG_SA_ROUND_ONE : BG_SA_ROUND_TWO;
|
||||
}
|
||||
if(TotalTime >= BG_SA_BOAT_START)
|
||||
if (TotalTime >= BG_SA_BOAT_START)
|
||||
StartShips();
|
||||
return;
|
||||
}
|
||||
else if (GetStatus() == STATUS_IN_PROGRESS)
|
||||
{
|
||||
if(status == BG_SA_ROUND_ONE)
|
||||
if (status == BG_SA_ROUND_ONE)
|
||||
{
|
||||
if(TotalTime >= BG_SA_ROUNDLENGTH)
|
||||
if (TotalTime >= BG_SA_ROUNDLENGTH)
|
||||
{
|
||||
RoundScores[0].time = TotalTime;
|
||||
TotalTime = 0;
|
||||
@@ -259,23 +259,23 @@ void BattleGroundSA::Update(uint32 diff)
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if(status == BG_SA_ROUND_TWO)
|
||||
else if (status == BG_SA_ROUND_TWO)
|
||||
{
|
||||
if(TotalTime >= BG_SA_ROUNDLENGTH)
|
||||
if (TotalTime >= BG_SA_ROUNDLENGTH)
|
||||
{
|
||||
RoundScores[1].time = TotalTime;
|
||||
RoundScores[1].winner = (attackers == TEAM_ALLIANCE) ? TEAM_HORDE : TEAM_ALLIANCE;
|
||||
|
||||
if (RoundScores[0].time == RoundScores[1].time)
|
||||
EndBattleGround(NULL);
|
||||
else if(RoundScores[0].time < RoundScores[1].time)
|
||||
else if (RoundScores[0].time < RoundScores[1].time)
|
||||
EndBattleGround(RoundScores[0].winner == TEAM_ALLIANCE ? ALLIANCE : HORDE);
|
||||
else
|
||||
EndBattleGround(RoundScores[1].winner == TEAM_ALLIANCE ? ALLIANCE : HORDE);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if(status == BG_SA_ROUND_ONE || status == BG_SA_ROUND_TWO)
|
||||
if (status == BG_SA_ROUND_ONE || status == BG_SA_ROUND_TWO)
|
||||
SendTime();
|
||||
}
|
||||
}
|
||||
@@ -334,13 +334,13 @@ void BattleGroundSA::AddPlayer(Player *plr)
|
||||
//create score and add it to map, default values are set in constructor
|
||||
BattleGroundSAScore* sc = new BattleGroundSAScore;
|
||||
|
||||
if(!ShipsStarted)
|
||||
if (!ShipsStarted)
|
||||
{
|
||||
if(plr->GetTeamId() == attackers)
|
||||
if (plr->GetTeamId() == attackers)
|
||||
{
|
||||
plr->CastSpell(plr,12438,true);//Without this player falls before boat loads...
|
||||
|
||||
if(urand(0,1))
|
||||
if (urand(0,1))
|
||||
plr->TeleportTo(607, 2682.936f, -830.368f, 50.0f, 2.895f, 0);
|
||||
else
|
||||
plr->TeleportTo(607, 2577.003f, 980.261f, 50.0f, 0.807f, 0);
|
||||
@@ -351,7 +351,7 @@ void BattleGroundSA::AddPlayer(Player *plr)
|
||||
}
|
||||
else
|
||||
{
|
||||
if(plr->GetTeamId() == attackers)
|
||||
if (plr->GetTeamId() == attackers)
|
||||
plr->TeleportTo(607, 1600.381f, -106.263f, 8.8745f, 3.78f, 0);
|
||||
else
|
||||
plr->TeleportTo(607, 1209.7f, -65.16f, 70.1f, 0.0f, 0);
|
||||
@@ -374,12 +374,12 @@ void BattleGroundSA::HandleAreaTrigger(Player * /*Source*/, uint32 /*Trigger*/)
|
||||
void BattleGroundSA::UpdatePlayerScore(Player* Source, uint32 type, uint32 value)
|
||||
{
|
||||
BattleGroundScoreMap::iterator itr = m_PlayerScores.find(Source->GetGUID());
|
||||
if(itr == m_PlayerScores.end()) // player not found...
|
||||
if (itr == m_PlayerScores.end()) // player not found...
|
||||
return;
|
||||
|
||||
if(type == SCORE_DESTROYED_DEMOLISHER)
|
||||
if (type == SCORE_DESTROYED_DEMOLISHER)
|
||||
((BattleGroundSAScore*)itr->second)->demolishers_destroyed += value;
|
||||
else if(type == SCORE_DESTROYED_WALL)
|
||||
else if (type == SCORE_DESTROYED_WALL)
|
||||
((BattleGroundSAScore*)itr->second)->gates_destroyed += value;
|
||||
else
|
||||
BattleGround::UpdatePlayerScore(Source,type,value);
|
||||
@@ -389,10 +389,10 @@ void BattleGroundSA::TeleportPlayers()
|
||||
{
|
||||
for (BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
|
||||
{
|
||||
if(Player *plr = objmgr.GetPlayer(itr->first))
|
||||
if (Player *plr = objmgr.GetPlayer(itr->first))
|
||||
{
|
||||
// should remove spirit of redemption
|
||||
if(plr->HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION))
|
||||
if (plr->HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION))
|
||||
plr->RemoveAurasByType(SPELL_AURA_MOD_SHAPESHIFT);
|
||||
|
||||
if (!plr->isAlive())
|
||||
@@ -405,11 +405,11 @@ void BattleGroundSA::TeleportPlayers()
|
||||
plr->SetPower(POWER_MANA, plr->GetMaxPower(POWER_MANA));
|
||||
plr->CombatStopWithPets(true);
|
||||
|
||||
if(plr->GetTeamId() == attackers)
|
||||
if (plr->GetTeamId() == attackers)
|
||||
{
|
||||
plr->CastSpell(plr,12438,true); //Without this player falls before boat loads...
|
||||
|
||||
if(urand(0,1))
|
||||
if (urand(0,1))
|
||||
plr->TeleportTo(607, 2682.936f, -830.368f, 50.0f, 2.895f, 0);
|
||||
else
|
||||
plr->TeleportTo(607, 2577.003f, 980.261f, 50.0f, 0.807f, 0);
|
||||
@@ -449,10 +449,10 @@ void BattleGroundSA::EventPlayerDamagedGO(Player* plr, GameObject* go, uint32 ev
|
||||
|
||||
void BattleGroundSA::HandleKillUnit(Creature* unit, Player* killer)
|
||||
{
|
||||
if(!unit)
|
||||
if (!unit)
|
||||
return;
|
||||
|
||||
if(unit->GetEntry() == 28781) //Demolisher
|
||||
if (unit->GetEntry() == 28781) //Demolisher
|
||||
UpdatePlayerScore(killer, SCORE_DESTROYED_DEMOLISHER, 1);
|
||||
}
|
||||
|
||||
@@ -462,30 +462,30 @@ void BattleGroundSA::HandleKillUnit(Creature* unit, Player* killer)
|
||||
*/
|
||||
void BattleGroundSA::OverrideGunFaction()
|
||||
{
|
||||
if(!m_BgCreatures[0])
|
||||
if (!m_BgCreatures[0])
|
||||
return;
|
||||
|
||||
for (uint8 i = BG_SA_GUN_1; i <= BG_SA_GUN_10;i++)
|
||||
{
|
||||
if(Creature* gun = GetBGCreature(i))
|
||||
if (Creature* gun = GetBGCreature(i))
|
||||
gun->setFaction(BG_SA_Factions[attackers? TEAM_ALLIANCE : TEAM_HORDE]);
|
||||
}
|
||||
|
||||
for (uint8 i = BG_SA_DEMOLISHER_1; i <= BG_SA_DEMOLISHER_4;i++)
|
||||
{
|
||||
if(Creature* dem = GetBGCreature(i))
|
||||
if (Creature* dem = GetBGCreature(i))
|
||||
dem->setFaction(BG_SA_Factions[attackers]);
|
||||
}
|
||||
}
|
||||
|
||||
void BattleGroundSA::DestroyGate(uint32 i, Player* pl)
|
||||
{
|
||||
if(!GateStatus[i])
|
||||
if (!GateStatus[i])
|
||||
return;
|
||||
|
||||
if(GameObject* g = GetBGObject(i))
|
||||
if (GameObject* g = GetBGObject(i))
|
||||
{
|
||||
if(g->GetGOValue()->building.health == 0)
|
||||
if (g->GetGOValue()->building.health == 0)
|
||||
{
|
||||
GateStatus[i] = BG_SA_GATE_DESTROYED;
|
||||
uint32 uws;
|
||||
@@ -514,7 +514,7 @@ void BattleGroundSA::DestroyGate(uint32 i, Player* pl)
|
||||
break;
|
||||
}
|
||||
|
||||
if(i < 5)
|
||||
if (i < 5)
|
||||
DelObject(i+9);
|
||||
UpdateWorldState(uws, GateStatus[i]);
|
||||
UpdatePlayerScore(pl,SCORE_DESTROYED_WALL, 1);
|
||||
@@ -531,7 +531,7 @@ WorldSafeLocsEntry const* BattleGroundSA::GetClosestGraveYard(Player* player)
|
||||
|
||||
player->GetPosition(x,y,z);
|
||||
|
||||
if(player->GetTeamId() == attackers)
|
||||
if (player->GetTeamId() == attackers)
|
||||
safeloc = BG_SA_GYEntries[BG_SA_BEACH_GY];
|
||||
else
|
||||
safeloc = BG_SA_GYEntries[BG_SA_DEFENDER_LAST_GY];
|
||||
@@ -541,11 +541,11 @@ WorldSafeLocsEntry const* BattleGroundSA::GetClosestGraveYard(Player* player)
|
||||
|
||||
for (uint8 i = BG_SA_RIGHT_CAPTURABLE_GY; i < BG_SA_MAX_GY; i++)
|
||||
{
|
||||
if(GraveyardStatus[i] != player->GetTeamId())
|
||||
if (GraveyardStatus[i] != player->GetTeamId())
|
||||
continue;
|
||||
|
||||
dist = sqrt((ret->x - x)*(ret->x - x) + (ret->y - y)*(ret->y - y)+(ret->z - z)*(ret->z - z));
|
||||
if(dist < nearest)
|
||||
if (dist < nearest)
|
||||
{
|
||||
ret = sWorldSafeLocsStore.LookupEntry(BG_SA_GYEntries[i]);
|
||||
nearest = dist;
|
||||
@@ -626,11 +626,11 @@ void BattleGroundSA::CaptureGraveyard(BG_SA_Graveyards i)
|
||||
|
||||
void BattleGroundSA::EventPlayerUsedGO(Player* Source, GameObject* object)
|
||||
{
|
||||
if(object->GetEntry() == BG_SA_ObjEntries[BG_SA_TITAN_RELIC])
|
||||
if (object->GetEntry() == BG_SA_ObjEntries[BG_SA_TITAN_RELIC])
|
||||
{
|
||||
if(Source->GetTeamId() == attackers)
|
||||
if (Source->GetTeamId() == attackers)
|
||||
{
|
||||
if(status == BG_SA_ROUND_ONE)
|
||||
if (status == BG_SA_ROUND_ONE)
|
||||
{
|
||||
RoundScores[0].winner = attackers;
|
||||
RoundScores[0].time = TotalTime;
|
||||
@@ -640,13 +640,13 @@ void BattleGroundSA::EventPlayerUsedGO(Player* Source, GameObject* object)
|
||||
ToggleTimer();
|
||||
ResetObjs();
|
||||
}
|
||||
else if(status == BG_SA_ROUND_TWO)
|
||||
else if (status == BG_SA_ROUND_TWO)
|
||||
{
|
||||
RoundScores[1].winner = attackers;
|
||||
RoundScores[1].time = TotalTime;ToggleTimer();
|
||||
if(RoundScores[0].time == RoundScores[1].time)
|
||||
if (RoundScores[0].time == RoundScores[1].time)
|
||||
EndBattleGround(NULL);
|
||||
else if(RoundScores[0].time < RoundScores[1].time)
|
||||
else if (RoundScores[0].time < RoundScores[1].time)
|
||||
EndBattleGround(RoundScores[0].winner == TEAM_ALLIANCE ? ALLIANCE : HORDE);
|
||||
else
|
||||
EndBattleGround(RoundScores[1].winner == TEAM_ALLIANCE ? ALLIANCE : HORDE);
|
||||
|
||||
Reference in New Issue
Block a user