diff options
-rw-r--r-- | src/game/Player.cpp | 54 | ||||
-rw-r--r-- | src/game/Player.h | 5 | ||||
-rw-r--r-- | src/game/Spell.cpp | 6 | ||||
-rw-r--r-- | src/game/World.cpp | 5 | ||||
-rw-r--r-- | src/game/World.h | 4 | ||||
-rw-r--r-- | src/trinitycore/trinitycore.conf.dist | 18 |
6 files changed, 7 insertions, 85 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 a02bd20275c..f13c251cc18 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -4177,9 +4177,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; @@ -5430,4 +5432,4 @@ int32 Spell::CalculateDamageDone(Unit *unit, const uint32 effectMask, float *mul } return damageDone; -}
\ No newline at end of file +} diff --git a/src/game/World.cpp b/src/game/World.cpp index 6aeed36f0f7..e84894bdb27 100644 --- a/src/game/World.cpp +++ b/src/game/World.cpp @@ -527,11 +527,6 @@ void World::LoadConfigSettings(bool reload) ///- Read other configuration items from the config file - ///- Do we allow flying mounts in Azeroth/Outland and others (others being instances, BGs, arenas)? - m_configs[CONFIG_FLYING_MOUNTS_AZEROTH] = sConfig.GetBoolDefault("FlyingMounts.Azeroth", false); - m_configs[CONFIG_FLYING_MOUNTS_OUTLAND] = sConfig.GetBoolDefault("FlyingMounts.Outland", true); - m_configs[CONFIG_FLYING_MOUNTS_OTHERS] = sConfig.GetBoolDefault("FlyingMounts.Others", false); - m_configs[CONFIG_COMPRESSION] = sConfig.GetIntDefault("Compression", 1); if(m_configs[CONFIG_COMPRESSION] < 1 || m_configs[CONFIG_COMPRESSION] > 9) { diff --git a/src/game/World.h b/src/game/World.h index e2e2096726a..63d9b52d7f2 100644 --- a/src/game/World.h +++ b/src/game/World.h @@ -184,10 +184,6 @@ enum WorldConfigs CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS, CONFIG_BATTLEGROUND_PREMATURE_FINISH_TIMER, - CONFIG_FLYING_MOUNTS_AZEROTH, - CONFIG_FLYING_MOUNTS_OUTLAND, - CONFIG_FLYING_MOUNTS_OTHERS, - CONFIG_MAX_WHO, CONFIG_BG_START_MUSIC, CONFIG_START_ALL_SPELLS, diff --git a/src/trinitycore/trinitycore.conf.dist b/src/trinitycore/trinitycore.conf.dist index c2e58216a86..827d5c238e7 100644 --- a/src/trinitycore/trinitycore.conf.dist +++ b/src/trinitycore/trinitycore.conf.dist @@ -502,21 +502,6 @@ LogColors = "" # Default: 0 (false) # 1 (true) # -# FlyingMounts.Azeroth -# Enable/disable flying mounts in Azeroth (map 0 and 1). -# Default: 0 - off -# 1 - on (may be crashy) -# -# FlyingMounts.Outland -# Enable/disable flying mounts in Outland (map 530). -# Default: 1 - on -# 0 - off -# -# FlyingMounts.Others -# Enable/disable flying mounts in other maps (instances, arenas, BGs, etc). -# Default: 0 - off -# 1 - on (may be crashy) -# # CastUnstuck # Allow cast or not Unstuck spell at .start or client Help option use # Default: 1 (true) @@ -622,9 +607,6 @@ ActivateWeather = 1 Battleground.CastDeserter = 1 Battleground.QueueAnnouncer.Enable = 1 Battleground.QueueAnnouncer.PlayerOnly = 0 -FlyingMounts.Azeroth = 0 -FlyingMounts.Outland = 1 -FlyingMounts.Others = 0 CastUnstuck = 1 Instance.IgnoreLevel = 0 Instance.IgnoreRaid = 0 |