aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells/SpellEffects.cpp
diff options
context:
space:
mode:
authorSpp <spp@jorge.gr>2012-10-04 12:49:58 +0200
committerSpp <spp@jorge.gr>2012-10-04 12:49:58 +0200
commit2c961814c1e65feb7e82be193adcea0a0081f00c (patch)
treecf201c494f583c54748f94c920c10ba2b2ff6eb6 /src/server/game/Spells/SpellEffects.cpp
parent2a55f2d9e081a3efef4dfe628c7d1496a6f2fb4e (diff)
Core/Battleground: Some minor optimizations here and there.
Diffstat (limited to 'src/server/game/Spells/SpellEffects.cpp')
-rwxr-xr-xsrc/server/game/Spells/SpellEffects.cpp34
1 files changed, 4 insertions, 30 deletions
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index cbc478078e5..b0db83e0187 100755
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -3632,36 +3632,10 @@ void Spell::EffectSummonObjectWild(SpellEffIndex effIndex)
// Wild object not have owner and check clickable by players
map->AddToMap(pGameObj);
- if (pGameObj->GetGoType() == GAMEOBJECT_TYPE_FLAGDROP && m_caster->GetTypeId() == TYPEID_PLAYER)
- {
- Player* player = m_caster->ToPlayer();
- Battleground* bg = player->GetBattleground();
-
- switch (pGameObj->GetMapId())
- {
- case 489: //WS
- {
- if (bg && bg->GetTypeID(true) == BATTLEGROUND_WS && bg->GetStatus() == STATUS_IN_PROGRESS)
- {
- uint32 team = ALLIANCE;
-
- if (player->GetTeam() == team)
- team = HORDE;
-
- ((BattlegroundWS*)bg)->SetDroppedFlagGUID(pGameObj->GetGUID(), team);
- }
- break;
- }
- case 566: //EY
- {
- if (bg && bg->GetTypeID(true) == BATTLEGROUND_EY && bg->GetStatus() == STATUS_IN_PROGRESS)
- {
- ((BattlegroundEY*)bg)->SetDroppedFlagGUID(pGameObj->GetGUID());
- }
- break;
- }
- }
- }
+ if (pGameObj->GetGoType() == GAMEOBJECT_TYPE_FLAGDROP)
+ if (Player* player = m_caster->ToPlayer())
+ if (Battleground* bg = player->GetBattleground())
+ bg->SetDroppedFlagGUID(pGameObj->GetGUID(), player->GetTeam() == ALLIANCE ? TEAM_HORDE: TEAM_ALLIANCE);
if (uint32 linkedEntry = pGameObj->GetGOInfo()->GetLinkedGameObjectEntry())
{