Core/ObjectMgr: Refactor sInstanceTemplate

This commit is contained in:
leak
2011-04-28 22:16:13 +02:00
parent 19cab2c508
commit 5aeb4fe794
14 changed files with 81 additions and 58 deletions
+3 -3
View File
@@ -5346,7 +5346,7 @@ SpellCastResult Spell::CheckCast(bool strict)
if (targetBind->perm && targetBind != m_caster->ToPlayer()->GetBoundInstance(mapId, difficulty))
return SPELL_FAILED_TARGET_LOCKED_TO_RAID_INSTANCE;
InstanceTemplate const* instance = ObjectMgr::GetInstanceTemplate(mapId);
InstanceTemplate const* instance = sObjectMgr->GetInstanceTemplate(mapId);
if (!instance)
return SPELL_FAILED_TARGET_NOT_IN_INSTANCE;
if (!target->Satisfy(sObjectMgr->GetAccessRequirement(mapId, difficulty), mapId))
@@ -5513,9 +5513,9 @@ SpellCastResult Spell::CheckCast(bool strict)
// Ignore map check if spell have AreaId. AreaId already checked and this prevent special mount spells
bool AllowMount = !m_caster->GetMap()->IsDungeon() || m_caster->GetMap()->IsBattlegroundOrArena();
InstanceTemplate const *it = ObjectMgr::GetInstanceTemplate(m_caster->GetMapId());
InstanceTemplate const *it = sObjectMgr->GetInstanceTemplate(m_caster->GetMapId());
if (it)
AllowMount = it->allowMount;
AllowMount = it->AllowMount;
if (m_caster->GetTypeId() == TYPEID_PLAYER && !AllowMount && !m_IsTriggeredSpell && !m_spellInfo->AreaGroupId)
return SPELL_FAILED_NO_MOUNTS_ALLOWED;