Core/ObjectMgr: Refactor sInstanceTemplate
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user