aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game/Player.cpp54
-rw-r--r--src/game/Player.h5
-rw-r--r--src/game/Spell.cpp6
3 files changed, 7 insertions, 58 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index 533b9e68ac2..e7ae690c5be 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -18753,7 +18753,8 @@ void Player::SetClientControl(Unit* target, uint8 allowMove)
void Player::UpdateZoneDependentAuras( uint32 newZone )
{
// remove new continent flight forms
- if(!CanFlyInMap(GetVirtualMapForMapAndZone(GetMapId(),newZone)))
+ if( !isGameMaster() &&
+ GetVirtualMapForMapAndZone(GetMapId(),newZone) != 530)
{
RemoveSpellsCausingAura(SPELL_AURA_MOD_INCREASE_FLIGHT_SPEED);
RemoveSpellsCausingAura(SPELL_AURA_FLY);
@@ -19219,54 +19220,3 @@ void Player::UpdateCharmedAI()
}
}
-bool Player::CanFlyInMap(const uint32 mapID) const
-{
- // we return false if the map doesn't even exist
- MapEntry const *entry = sMapStore.LookupEntry(mapID);
- if(!entry)
- {
- sLog.outDebug("Unknown mapID handed to Player::CanFlyInMap; disallowing flying.");
- return false;
- }
-
- // GMs can always fly
- if( isGameMaster() )
- {
- return true;
- }
-
- // check whether we can fly here depending on map/config
- switch(mapID)
- {
- // kalimdor/eastern kingdoms
- case 0:
- case 1:
- {
- return sWorld.getConfig(CONFIG_FLYING_MOUNTS_AZEROTH);
- }
- // outland
- case 530:
- {
- return sWorld.getConfig(CONFIG_FLYING_MOUNTS_OUTLAND);
- }
- // all other maps
- default:
- {
- return sWorld.getConfig(CONFIG_FLYING_MOUNTS_OTHERS);
- }
- }
-}
-
-// this is just a dummy function that does the same as CanFlyInMap, but based on area ID
-bool Player::CanFlyInArea(const uint32 areaID) const
-{
- // we return false if the area doesn't even exist
- AreaTableEntry const *entry = sAreaStore.LookupEntry(areaID);
- if(!entry)
- {
- sLog.outDebug("Unknown areaID handed to Player::CanFlyInArea; disallowing flying.");
- return false;
- }
-
- return CanFlyInMap(entry->mapid);
-}
diff --git a/src/game/Player.h b/src/game/Player.h
index 90a0f29ab81..a5fd39a8908 100644
--- a/src/game/Player.h
+++ b/src/game/Player.h
@@ -2036,10 +2036,7 @@ class TRINITY_DLL_SPEC Player : public Unit
uint32 GetOldPetSpell() const { return m_oldpetspell; }
void SetOldPetSpell(uint32 petspell) { m_oldpetspell = petspell; }
- // check if player can fly in map/area according to config
- bool CanFlyInMap(const uint32 mapID) const;
- bool CanFlyInArea(const uint32 areaID) const;
-
+
/*********************************************************/
/*** INSTANCE SYSTEM ***/
/*********************************************************/
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index fb5662bfd7b..7963a9b0872 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -4172,9 +4172,11 @@ uint8 Spell::CanCast(bool strict)
case SPELL_AURA_MOD_INCREASE_FLIGHT_SPEED:
case SPELL_AURA_FLY:
{
+ // not allow cast fly spells at old maps by players (all spells is self target)
if(m_caster->GetTypeId()==TYPEID_PLAYER)
{
- if(!((Player*)m_caster)->CanFlyInMap(GetVirtualMapForMapAndZone(m_caster->GetMapId(),m_caster->GetZoneId())))
+ if( !((Player*)m_caster)->isGameMaster() &&
+ GetVirtualMapForMapAndZone(m_caster->GetMapId(),m_caster->GetZoneId()) != 530)
return SPELL_FAILED_NOT_HERE;
}
break;
@@ -5425,4 +5427,4 @@ int32 Spell::CalculateDamageDone(Unit *unit, const uint32 effectMask, float *mul
}
return damageDone;
-} \ No newline at end of file
+}