mirror of
https://github.com/mangosfour/server.git
synced 2025-12-17 07:37:03 +00:00
[7632] more "if"-condition related codestyle in battlegroundfiles
this time with this regex: sed -i 's/if *( *\(.*\) *)$/if (\1)/' BattleGround*
This commit is contained in:
parent
73d12d7ccf
commit
6b2fd22a9c
14 changed files with 346 additions and 346 deletions
|
|
@ -45,43 +45,43 @@ void BattleGroundWS::Update(uint32 diff)
|
|||
{
|
||||
BattleGround::Update(diff);
|
||||
|
||||
if(GetStatus() == STATUS_IN_PROGRESS)
|
||||
if (GetStatus() == STATUS_IN_PROGRESS)
|
||||
{
|
||||
if(m_FlagState[BG_TEAM_ALLIANCE] == BG_WS_FLAG_STATE_WAIT_RESPAWN)
|
||||
if (m_FlagState[BG_TEAM_ALLIANCE] == BG_WS_FLAG_STATE_WAIT_RESPAWN)
|
||||
{
|
||||
m_FlagsTimer[BG_TEAM_ALLIANCE] -= diff;
|
||||
|
||||
if(m_FlagsTimer[BG_TEAM_ALLIANCE] < 0)
|
||||
if (m_FlagsTimer[BG_TEAM_ALLIANCE] < 0)
|
||||
{
|
||||
m_FlagsTimer[BG_TEAM_ALLIANCE] = 0;
|
||||
RespawnFlag(ALLIANCE, true);
|
||||
}
|
||||
}
|
||||
if(m_FlagState[BG_TEAM_ALLIANCE] == BG_WS_FLAG_STATE_ON_GROUND)
|
||||
if (m_FlagState[BG_TEAM_ALLIANCE] == BG_WS_FLAG_STATE_ON_GROUND)
|
||||
{
|
||||
m_FlagsDropTimer[BG_TEAM_ALLIANCE] -= diff;
|
||||
|
||||
if(m_FlagsDropTimer[BG_TEAM_ALLIANCE] < 0)
|
||||
if (m_FlagsDropTimer[BG_TEAM_ALLIANCE] < 0)
|
||||
{
|
||||
m_FlagsDropTimer[BG_TEAM_ALLIANCE] = 0;
|
||||
RespawnFlagAfterDrop(ALLIANCE);
|
||||
}
|
||||
}
|
||||
if(m_FlagState[BG_TEAM_HORDE] == BG_WS_FLAG_STATE_WAIT_RESPAWN)
|
||||
if (m_FlagState[BG_TEAM_HORDE] == BG_WS_FLAG_STATE_WAIT_RESPAWN)
|
||||
{
|
||||
m_FlagsTimer[BG_TEAM_HORDE] -= diff;
|
||||
|
||||
if(m_FlagsTimer[BG_TEAM_HORDE] < 0)
|
||||
if (m_FlagsTimer[BG_TEAM_HORDE] < 0)
|
||||
{
|
||||
m_FlagsTimer[BG_TEAM_HORDE] = 0;
|
||||
RespawnFlag(HORDE, true);
|
||||
}
|
||||
}
|
||||
if(m_FlagState[BG_TEAM_HORDE] == BG_WS_FLAG_STATE_ON_GROUND)
|
||||
if (m_FlagState[BG_TEAM_HORDE] == BG_WS_FLAG_STATE_ON_GROUND)
|
||||
{
|
||||
m_FlagsDropTimer[BG_TEAM_HORDE] -= diff;
|
||||
|
||||
if(m_FlagsDropTimer[BG_TEAM_HORDE] < 0)
|
||||
if (m_FlagsDropTimer[BG_TEAM_HORDE] < 0)
|
||||
{
|
||||
m_FlagsDropTimer[BG_TEAM_HORDE] = 0;
|
||||
RespawnFlagAfterDrop(HORDE);
|
||||
|
|
@ -128,7 +128,7 @@ void BattleGroundWS::AddPlayer(Player *plr)
|
|||
|
||||
void BattleGroundWS::RespawnFlag(uint32 Team, bool captured)
|
||||
{
|
||||
if(Team == ALLIANCE)
|
||||
if (Team == ALLIANCE)
|
||||
{
|
||||
sLog.outDebug("Respawn Alliance flag");
|
||||
m_FlagState[BG_TEAM_ALLIANCE] = BG_WS_FLAG_STATE_ON_BASE;
|
||||
|
|
@ -139,7 +139,7 @@ void BattleGroundWS::RespawnFlag(uint32 Team, bool captured)
|
|||
m_FlagState[BG_TEAM_HORDE] = BG_WS_FLAG_STATE_ON_BASE;
|
||||
}
|
||||
|
||||
if(captured)
|
||||
if (captured)
|
||||
{
|
||||
//when map_update will be allowed for battlegrounds this code will be useless
|
||||
SpawnBGObject(BG_WS_OBJECT_H_FLAG, RESPAWN_IMMEDIATELY);
|
||||
|
|
@ -151,11 +151,11 @@ void BattleGroundWS::RespawnFlag(uint32 Team, bool captured)
|
|||
|
||||
void BattleGroundWS::RespawnFlagAfterDrop(uint32 team)
|
||||
{
|
||||
if(GetStatus() != STATUS_IN_PROGRESS)
|
||||
if (GetStatus() != STATUS_IN_PROGRESS)
|
||||
return;
|
||||
|
||||
RespawnFlag(team,false);
|
||||
if(team == ALLIANCE)
|
||||
if (team == ALLIANCE)
|
||||
{
|
||||
SpawnBGObject(BG_WS_OBJECT_A_FLAG, RESPAWN_IMMEDIATELY);
|
||||
SendMessageToAll(LANG_BG_WS_ALLIANCE_FLAG_RESPAWNED, CHAT_MSG_BG_SYSTEM_NEUTRAL);
|
||||
|
|
@ -169,7 +169,7 @@ void BattleGroundWS::RespawnFlagAfterDrop(uint32 team)
|
|||
PlaySoundToAll(BG_WS_SOUND_FLAGS_RESPAWNED);
|
||||
|
||||
GameObject *obj = HashMapHolder<GameObject>::Find(GetDroppedFlagGUID(team));
|
||||
if(obj)
|
||||
if (obj)
|
||||
obj->Delete();
|
||||
else
|
||||
sLog.outError("unknown droped flag bg, guid: %u",GUID_LOPART(GetDroppedFlagGUID(team)));
|
||||
|
|
@ -179,13 +179,13 @@ void BattleGroundWS::RespawnFlagAfterDrop(uint32 team)
|
|||
|
||||
void BattleGroundWS::EventPlayerCapturedFlag(Player *Source)
|
||||
{
|
||||
if(GetStatus() != STATUS_IN_PROGRESS)
|
||||
if (GetStatus() != STATUS_IN_PROGRESS)
|
||||
return;
|
||||
|
||||
uint32 winner = 0;
|
||||
|
||||
Source->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT);
|
||||
if(Source->GetTeam() == ALLIANCE)
|
||||
if (Source->GetTeam() == ALLIANCE)
|
||||
{
|
||||
if (!IsHordeFlagPickedup())
|
||||
return;
|
||||
|
|
@ -194,7 +194,7 @@ void BattleGroundWS::EventPlayerCapturedFlag(Player *Source)
|
|||
m_FlagState[BG_TEAM_HORDE] = BG_WS_FLAG_STATE_WAIT_RESPAWN;
|
||||
// Drop Horde Flag from Player
|
||||
Source->RemoveAurasDueToSpell(BG_WS_SPELL_WARSONG_FLAG);
|
||||
if(GetTeamScore(ALLIANCE) < BG_WS_MAX_TEAM_SCORE)
|
||||
if (GetTeamScore(ALLIANCE) < BG_WS_MAX_TEAM_SCORE)
|
||||
AddPoint(ALLIANCE, 1);
|
||||
PlaySoundToAll(BG_WS_SOUND_FLAG_CAPTURED_ALLIANCE);
|
||||
RewardReputationToTeam(890, m_ReputationCapture, ALLIANCE);
|
||||
|
|
@ -208,7 +208,7 @@ void BattleGroundWS::EventPlayerCapturedFlag(Player *Source)
|
|||
m_FlagState[BG_TEAM_ALLIANCE] = BG_WS_FLAG_STATE_WAIT_RESPAWN;
|
||||
// Drop Alliance Flag from Player
|
||||
Source->RemoveAurasDueToSpell(BG_WS_SPELL_SILVERWING_FLAG);
|
||||
if(GetTeamScore(HORDE) < BG_WS_MAX_TEAM_SCORE)
|
||||
if (GetTeamScore(HORDE) < BG_WS_MAX_TEAM_SCORE)
|
||||
AddPoint(HORDE, 1);
|
||||
PlaySoundToAll(BG_WS_SOUND_FLAG_CAPTURED_HORDE);
|
||||
RewardReputationToTeam(889, m_ReputationCapture, HORDE);
|
||||
|
|
@ -219,7 +219,7 @@ void BattleGroundWS::EventPlayerCapturedFlag(Player *Source)
|
|||
SpawnBGObject(BG_WS_OBJECT_H_FLAG, BG_WS_FLAG_RESPAWN_TIME);
|
||||
SpawnBGObject(BG_WS_OBJECT_A_FLAG, BG_WS_FLAG_RESPAWN_TIME);
|
||||
|
||||
if(Source->GetTeam() == ALLIANCE)
|
||||
if (Source->GetTeam() == ALLIANCE)
|
||||
SendMessageToAll(LANG_BG_WS_CAPTURED_HF, CHAT_MSG_BG_SYSTEM_ALLIANCE, Source);
|
||||
else
|
||||
SendMessageToAll(LANG_BG_WS_CAPTURED_AF, CHAT_MSG_BG_SYSTEM_HORDE, Source);
|
||||
|
|
@ -229,13 +229,13 @@ void BattleGroundWS::EventPlayerCapturedFlag(Player *Source)
|
|||
// only flag capture should be updated
|
||||
UpdatePlayerScore(Source, SCORE_FLAG_CAPTURES, 1); // +1 flag captures
|
||||
|
||||
if(GetTeamScore(ALLIANCE) == BG_WS_MAX_TEAM_SCORE)
|
||||
if (GetTeamScore(ALLIANCE) == BG_WS_MAX_TEAM_SCORE)
|
||||
winner = ALLIANCE;
|
||||
|
||||
if(GetTeamScore(HORDE) == BG_WS_MAX_TEAM_SCORE)
|
||||
if (GetTeamScore(HORDE) == BG_WS_MAX_TEAM_SCORE)
|
||||
winner = HORDE;
|
||||
|
||||
if(winner)
|
||||
if (winner)
|
||||
{
|
||||
UpdateWorldState(BG_WS_FLAG_UNK_ALLIANCE, 0);
|
||||
UpdateWorldState(BG_WS_FLAG_UNK_HORDE, 0);
|
||||
|
|
@ -252,15 +252,15 @@ void BattleGroundWS::EventPlayerCapturedFlag(Player *Source)
|
|||
|
||||
void BattleGroundWS::EventPlayerDroppedFlag(Player *Source)
|
||||
{
|
||||
if(GetStatus() != STATUS_IN_PROGRESS)
|
||||
if (GetStatus() != STATUS_IN_PROGRESS)
|
||||
{
|
||||
// if not running, do not cast things at the dropper player (prevent spawning the "dropped" flag), neither send unnecessary messages
|
||||
// just take off the aura
|
||||
if(Source->GetTeam() == ALLIANCE)
|
||||
if (Source->GetTeam() == ALLIANCE)
|
||||
{
|
||||
if(!this->IsHordeFlagPickedup())
|
||||
if (!this->IsHordeFlagPickedup())
|
||||
return;
|
||||
if(GetHordeFlagPickerGUID() == Source->GetGUID())
|
||||
if (GetHordeFlagPickerGUID() == Source->GetGUID())
|
||||
{
|
||||
SetHordeFlagPicker(0);
|
||||
Source->RemoveAurasDueToSpell(BG_WS_SPELL_WARSONG_FLAG);
|
||||
|
|
@ -268,9 +268,9 @@ void BattleGroundWS::EventPlayerDroppedFlag(Player *Source)
|
|||
}
|
||||
else
|
||||
{
|
||||
if(!this->IsAllianceFlagPickedup())
|
||||
if (!this->IsAllianceFlagPickedup())
|
||||
return;
|
||||
if(GetAllianceFlagPickerGUID() == Source->GetGUID())
|
||||
if (GetAllianceFlagPickerGUID() == Source->GetGUID())
|
||||
{
|
||||
SetAllianceFlagPicker(0);
|
||||
Source->RemoveAurasDueToSpell(BG_WS_SPELL_SILVERWING_FLAG);
|
||||
|
|
@ -281,11 +281,11 @@ void BattleGroundWS::EventPlayerDroppedFlag(Player *Source)
|
|||
|
||||
bool set = false;
|
||||
|
||||
if(Source->GetTeam() == ALLIANCE)
|
||||
if (Source->GetTeam() == ALLIANCE)
|
||||
{
|
||||
if(!IsHordeFlagPickedup())
|
||||
if (!IsHordeFlagPickedup())
|
||||
return;
|
||||
if(GetHordeFlagPickerGUID() == Source->GetGUID())
|
||||
if (GetHordeFlagPickerGUID() == Source->GetGUID())
|
||||
{
|
||||
SetHordeFlagPicker(0);
|
||||
Source->RemoveAurasDueToSpell(BG_WS_SPELL_WARSONG_FLAG);
|
||||
|
|
@ -296,9 +296,9 @@ void BattleGroundWS::EventPlayerDroppedFlag(Player *Source)
|
|||
}
|
||||
else
|
||||
{
|
||||
if(!IsAllianceFlagPickedup())
|
||||
if (!IsAllianceFlagPickedup())
|
||||
return;
|
||||
if(GetAllianceFlagPickerGUID() == Source->GetGUID())
|
||||
if (GetAllianceFlagPickerGUID() == Source->GetGUID())
|
||||
{
|
||||
SetAllianceFlagPicker(0);
|
||||
Source->RemoveAurasDueToSpell(BG_WS_SPELL_SILVERWING_FLAG);
|
||||
|
|
@ -313,7 +313,7 @@ void BattleGroundWS::EventPlayerDroppedFlag(Player *Source)
|
|||
Source->CastSpell(Source, SPELL_RECENTLY_DROPPED_FLAG, true);
|
||||
UpdateFlagState(Source->GetTeam(), 1);
|
||||
|
||||
if(Source->GetTeam() == ALLIANCE)
|
||||
if (Source->GetTeam() == ALLIANCE)
|
||||
{
|
||||
SendMessageToAll(LANG_BG_WS_DROPPED_HF, CHAT_MSG_BG_SYSTEM_HORDE, Source);
|
||||
UpdateWorldState(BG_WS_FLAG_UNK_HORDE, uint32(-1));
|
||||
|
|
@ -330,7 +330,7 @@ void BattleGroundWS::EventPlayerDroppedFlag(Player *Source)
|
|||
|
||||
void BattleGroundWS::EventPlayerClickedOnFlag(Player *Source, GameObject* target_obj)
|
||||
{
|
||||
if(GetStatus() != STATUS_IN_PROGRESS)
|
||||
if (GetStatus() != STATUS_IN_PROGRESS)
|
||||
return;
|
||||
|
||||
int32 message_id = 0;
|
||||
|
|
@ -369,9 +369,9 @@ void BattleGroundWS::EventPlayerClickedOnFlag(Player *Source, GameObject* target
|
|||
}
|
||||
|
||||
//Alliance flag on ground(not in base) (returned or picked up again from ground!)
|
||||
if(GetFlagState(ALLIANCE) == BG_WS_FLAG_STATE_ON_GROUND && Source->IsWithinDistInMap(target_obj, 10))
|
||||
if (GetFlagState(ALLIANCE) == BG_WS_FLAG_STATE_ON_GROUND && Source->IsWithinDistInMap(target_obj, 10))
|
||||
{
|
||||
if(Source->GetTeam() == ALLIANCE)
|
||||
if (Source->GetTeam() == ALLIANCE)
|
||||
{
|
||||
message_id = LANG_BG_WS_RETURNED_AF;
|
||||
type = CHAT_MSG_BG_SYSTEM_ALLIANCE;
|
||||
|
|
@ -398,9 +398,9 @@ void BattleGroundWS::EventPlayerClickedOnFlag(Player *Source, GameObject* target
|
|||
}
|
||||
|
||||
//Horde flag on ground(not in base) (returned or picked up again)
|
||||
if(GetFlagState(HORDE) == BG_WS_FLAG_STATE_ON_GROUND && Source->IsWithinDistInMap(target_obj, 10))
|
||||
if (GetFlagState(HORDE) == BG_WS_FLAG_STATE_ON_GROUND && Source->IsWithinDistInMap(target_obj, 10))
|
||||
{
|
||||
if(Source->GetTeam() == HORDE)
|
||||
if (Source->GetTeam() == HORDE)
|
||||
{
|
||||
message_id = LANG_BG_WS_RETURNED_HF;
|
||||
type = CHAT_MSG_BG_SYSTEM_HORDE;
|
||||
|
|
@ -436,9 +436,9 @@ void BattleGroundWS::EventPlayerClickedOnFlag(Player *Source, GameObject* target
|
|||
void BattleGroundWS::RemovePlayer(Player *plr, uint64 guid)
|
||||
{
|
||||
// sometimes flag aura not removed :(
|
||||
if(IsAllianceFlagPickedup() && m_FlagKeepers[BG_TEAM_ALLIANCE] == guid)
|
||||
if (IsAllianceFlagPickedup() && m_FlagKeepers[BG_TEAM_ALLIANCE] == guid)
|
||||
{
|
||||
if(!plr)
|
||||
if (!plr)
|
||||
{
|
||||
sLog.outError("BattleGroundWS: Removing offline player who has the FLAG!!");
|
||||
SetAllianceFlagPicker(0);
|
||||
|
|
@ -447,9 +447,9 @@ void BattleGroundWS::RemovePlayer(Player *plr, uint64 guid)
|
|||
else
|
||||
EventPlayerDroppedFlag(plr);
|
||||
}
|
||||
if(IsHordeFlagPickedup() && m_FlagKeepers[BG_TEAM_HORDE] == guid)
|
||||
if (IsHordeFlagPickedup() && m_FlagKeepers[BG_TEAM_HORDE] == guid)
|
||||
{
|
||||
if(!plr)
|
||||
if (!plr)
|
||||
{
|
||||
sLog.outError("BattleGroundWS: Removing offline player who has the FLAG!!");
|
||||
SetHordeFlagPicker(0);
|
||||
|
|
@ -462,7 +462,7 @@ void BattleGroundWS::RemovePlayer(Player *plr, uint64 guid)
|
|||
|
||||
void BattleGroundWS::UpdateFlagState(uint32 team, uint32 value)
|
||||
{
|
||||
if(team == ALLIANCE)
|
||||
if (team == ALLIANCE)
|
||||
UpdateWorldState(BG_WS_FLAG_STATE_ALLIANCE, value);
|
||||
else
|
||||
UpdateWorldState(BG_WS_FLAG_STATE_HORDE, value);
|
||||
|
|
@ -470,7 +470,7 @@ void BattleGroundWS::UpdateFlagState(uint32 team, uint32 value)
|
|||
|
||||
void BattleGroundWS::UpdateTeamScore(uint32 team)
|
||||
{
|
||||
if(team == ALLIANCE)
|
||||
if (team == ALLIANCE)
|
||||
UpdateWorldState(BG_WS_FLAG_CAPTURES_ALLIANCE, GetTeamScore(team));
|
||||
else
|
||||
UpdateWorldState(BG_WS_FLAG_CAPTURES_HORDE, GetTeamScore(team));
|
||||
|
|
@ -479,7 +479,7 @@ void BattleGroundWS::UpdateTeamScore(uint32 team)
|
|||
void BattleGroundWS::HandleAreaTrigger(Player *Source, uint32 Trigger)
|
||||
{
|
||||
// this is wrong way to implement these things. On official it done by gameobject spell cast.
|
||||
if(GetStatus() != STATUS_IN_PROGRESS)
|
||||
if (GetStatus() != STATUS_IN_PROGRESS)
|
||||
return;
|
||||
|
||||
//uint32 SpellId = 0;
|
||||
|
|
@ -505,13 +505,13 @@ void BattleGroundWS::HandleAreaTrigger(Player *Source, uint32 Trigger)
|
|||
//buff_guid = m_BgObjects[BG_WS_OBJECT_BERSERKBUFF_2];
|
||||
break;
|
||||
case 3646: // Alliance Flag spawn
|
||||
if(m_FlagState[BG_TEAM_HORDE] && !m_FlagState[BG_TEAM_ALLIANCE])
|
||||
if(GetHordeFlagPickerGUID() == Source->GetGUID())
|
||||
if (m_FlagState[BG_TEAM_HORDE] && !m_FlagState[BG_TEAM_ALLIANCE])
|
||||
if (GetHordeFlagPickerGUID() == Source->GetGUID())
|
||||
EventPlayerCapturedFlag(Source);
|
||||
break;
|
||||
case 3647: // Horde Flag spawn
|
||||
if(m_FlagState[BG_TEAM_ALLIANCE] && !m_FlagState[BG_TEAM_HORDE])
|
||||
if(GetAllianceFlagPickerGUID() == Source->GetGUID())
|
||||
if (m_FlagState[BG_TEAM_ALLIANCE] && !m_FlagState[BG_TEAM_HORDE])
|
||||
if (GetAllianceFlagPickerGUID() == Source->GetGUID())
|
||||
EventPlayerCapturedFlag(Source);
|
||||
break;
|
||||
case 3649: // unk1
|
||||
|
|
@ -525,14 +525,14 @@ void BattleGroundWS::HandleAreaTrigger(Player *Source, uint32 Trigger)
|
|||
break;
|
||||
}
|
||||
|
||||
//if(buff_guid)
|
||||
//if (buff_guid)
|
||||
// HandleTriggerBuff(buff_guid,Source);
|
||||
}
|
||||
|
||||
bool BattleGroundWS::SetupBattleGround()
|
||||
{
|
||||
// flags
|
||||
if( !AddObject(BG_WS_OBJECT_A_FLAG, BG_OBJECT_A_FLAG_WS_ENTRY, 1540.423f, 1481.325f, 351.8284f, 3.089233f, 0, 0, 0.9996573f, 0.02617699f, BG_WS_FLAG_RESPAWN_TIME/1000)
|
||||
if (!AddObject(BG_WS_OBJECT_A_FLAG, BG_OBJECT_A_FLAG_WS_ENTRY, 1540.423f, 1481.325f, 351.8284f, 3.089233f, 0, 0, 0.9996573f, 0.02617699f, BG_WS_FLAG_RESPAWN_TIME/1000)
|
||||
|| !AddObject(BG_WS_OBJECT_H_FLAG, BG_OBJECT_H_FLAG_WS_ENTRY, 916.0226f, 1434.405f, 345.413f, 0.01745329f, 0, 0, 0.008726535f, 0.9999619f, BG_WS_FLAG_RESPAWN_TIME/1000)
|
||||
// buffs
|
||||
|| !AddObject(BG_WS_OBJECT_SPEEDBUFF_1, BG_OBJECTID_SPEEDBUFF_ENTRY, 1449.93f, 1470.71f, 342.6346f, -1.64061f, 0, 0, 0.7313537f, -0.6819983f, BUFF_RESPAWN_TIME)
|
||||
|
|
@ -560,14 +560,14 @@ bool BattleGroundWS::SetupBattleGround()
|
|||
}
|
||||
|
||||
WorldSafeLocsEntry const *sg = sWorldSafeLocsStore.LookupEntry(WS_GRAVEYARD_MAIN_ALLIANCE);
|
||||
if(!sg || !AddSpiritGuide(WS_SPIRIT_MAIN_ALLIANCE, sg->x, sg->y, sg->z, 3.124139f, ALLIANCE))
|
||||
if (!sg || !AddSpiritGuide(WS_SPIRIT_MAIN_ALLIANCE, sg->x, sg->y, sg->z, 3.124139f, ALLIANCE))
|
||||
{
|
||||
sLog.outErrorDb("BatteGroundWS: Failed to spawn Alliance spirit guide! BattleGround not created!");
|
||||
return false;
|
||||
}
|
||||
|
||||
sg = sWorldSafeLocsStore.LookupEntry(WS_GRAVEYARD_MAIN_HORDE);
|
||||
if(!sg || !AddSpiritGuide(WS_SPIRIT_MAIN_HORDE, sg->x, sg->y, sg->z, 3.193953f, HORDE))
|
||||
if (!sg || !AddSpiritGuide(WS_SPIRIT_MAIN_HORDE, sg->x, sg->y, sg->z, 3.193953f, HORDE))
|
||||
{
|
||||
sLog.outErrorDb("BatteGroundWS: Failed to spawn Horde spirit guide! BattleGround not created!");
|
||||
return false;
|
||||
|
|
@ -597,9 +597,9 @@ void BattleGroundWS::Reset()
|
|||
m_HonorEndKills = (isBGWeekend) ? 4 : 2;
|
||||
|
||||
/* Spirit nodes is static at this BG and then not required deleting at BG reset.
|
||||
if(m_BgCreatures[WS_SPIRIT_MAIN_ALLIANCE])
|
||||
if (m_BgCreatures[WS_SPIRIT_MAIN_ALLIANCE])
|
||||
DelCreature(WS_SPIRIT_MAIN_ALLIANCE);
|
||||
if(m_BgCreatures[WS_SPIRIT_MAIN_HORDE])
|
||||
if (m_BgCreatures[WS_SPIRIT_MAIN_HORDE])
|
||||
DelCreature(WS_SPIRIT_MAIN_HORDE);
|
||||
*/
|
||||
}
|
||||
|
|
@ -620,7 +620,7 @@ void BattleGroundWS::EndBattleGround(uint32 winner)
|
|||
|
||||
void BattleGroundWS::HandleKillPlayer(Player *player, Player *killer)
|
||||
{
|
||||
if(GetStatus() != STATUS_IN_PROGRESS)
|
||||
if (GetStatus() != STATUS_IN_PROGRESS)
|
||||
return;
|
||||
|
||||
EventPlayerDroppedFlag(player);
|
||||
|
|
@ -657,16 +657,16 @@ WorldSafeLocsEntry const* BattleGroundWS::GetClosestGraveYard(Player* player)
|
|||
//if a player dies in preparation phase - then the player can't cheat
|
||||
//and teleport to the graveyard outside the flagroom
|
||||
//and start running around, while the doors are still closed
|
||||
if(player->GetTeam() == ALLIANCE)
|
||||
if (player->GetTeam() == ALLIANCE)
|
||||
{
|
||||
if(GetStatus() == STATUS_IN_PROGRESS)
|
||||
if (GetStatus() == STATUS_IN_PROGRESS)
|
||||
return sWorldSafeLocsStore.LookupEntry(WS_GRAVEYARD_MAIN_ALLIANCE);
|
||||
else
|
||||
return sWorldSafeLocsStore.LookupEntry(WS_GRAVEYARD_FLAGROOM_ALLIANCE);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(GetStatus() == STATUS_IN_PROGRESS)
|
||||
if (GetStatus() == STATUS_IN_PROGRESS)
|
||||
return sWorldSafeLocsStore.LookupEntry(WS_GRAVEYARD_MAIN_HORDE);
|
||||
else
|
||||
return sWorldSafeLocsStore.LookupEntry(WS_GRAVEYARD_FLAGROOM_HORDE);
|
||||
|
|
@ -678,14 +678,14 @@ void BattleGroundWS::FillInitialWorldStates(WorldPacket& data)
|
|||
data << uint32(BG_WS_FLAG_CAPTURES_ALLIANCE) << uint32(GetTeamScore(ALLIANCE));
|
||||
data << uint32(BG_WS_FLAG_CAPTURES_HORDE) << uint32(GetTeamScore(HORDE));
|
||||
|
||||
if(m_FlagState[BG_TEAM_ALLIANCE] == BG_WS_FLAG_STATE_ON_GROUND)
|
||||
if (m_FlagState[BG_TEAM_ALLIANCE] == BG_WS_FLAG_STATE_ON_GROUND)
|
||||
data << uint32(BG_WS_FLAG_UNK_ALLIANCE) << uint32(-1);
|
||||
else if (m_FlagState[BG_TEAM_ALLIANCE] == BG_WS_FLAG_STATE_ON_PLAYER)
|
||||
data << uint32(BG_WS_FLAG_UNK_ALLIANCE) << uint32(1);
|
||||
else
|
||||
data << uint32(BG_WS_FLAG_UNK_ALLIANCE) << uint32(0);
|
||||
|
||||
if(m_FlagState[BG_TEAM_HORDE] == BG_WS_FLAG_STATE_ON_GROUND)
|
||||
if (m_FlagState[BG_TEAM_HORDE] == BG_WS_FLAG_STATE_ON_GROUND)
|
||||
data << uint32(BG_WS_FLAG_UNK_HORDE) << uint32(-1);
|
||||
else if (m_FlagState[BG_TEAM_HORDE] == BG_WS_FLAG_STATE_ON_PLAYER)
|
||||
data << uint32(BG_WS_FLAG_UNK_HORDE) << uint32(1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue