diff options
Diffstat (limited to 'src/game')
| -rw-r--r-- | src/game/Spell.cpp | 26 | ||||
| -rw-r--r-- | src/game/World.cpp | 5 | ||||
| -rw-r--r-- | src/game/World.h | 4 |
3 files changed, 32 insertions, 3 deletions
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index aa0d24ffdb8..ddfb9c01be5 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -4168,9 +4168,29 @@ uint8 Spell::CanCast(bool strict) // 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)->isGameMaster() && - GetVirtualMapForMapAndZone(m_caster->GetMapId(),m_caster->GetZoneId()) != 530) - return SPELL_FAILED_NOT_HERE; + if(!((Player*)m_caster)->isGameMaster()) + { + uint32 v_map = GetVirtualMapForMapAndZone(m_caster->GetMapId(),m_caster->GetZoneId()); + switch(v_map) + { + case 0: + case 1: + { + if (!sWorld.getConfig(CONFIG_FLYING_MOUNTS_AZEROTH)) + return SPELL_FAILED_NOT_HERE; + } break; + case 530: + { + if (!sWorld.getConfig(CONFIG_FLYING_MOUNTS_OUTLAND)) + return SPELL_FAILED_NOT_HERE; + } break; + default: + { + if (!sWorld.getConfig(CONFIG_FLYING_MOUNTS_OTHERS)) + return SPELL_FAILED_NOT_HERE; + } break; + } + } } break; diff --git a/src/game/World.cpp b/src/game/World.cpp index 89a0b75cd36..219c656dcaf 100644 --- a/src/game/World.cpp +++ b/src/game/World.cpp @@ -526,6 +526,11 @@ 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 63d9b52d7f2..e2e2096726a 100644 --- a/src/game/World.h +++ b/src/game/World.h @@ -184,6 +184,10 @@ 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, |
