diff options
author | Shauren <none@none> | 2010-07-21 15:17:29 +0200 |
---|---|---|
committer | Shauren <none@none> | 2010-07-21 15:17:29 +0200 |
commit | 14b6a688570c9bc029de28321779c30e4129577b (patch) | |
tree | dd1c406b0c38415acbb7c380f9448ff28249d48d /src/server/game/Conditions/DisableMgr.cpp | |
parent | 19ed86ef3046517325451f2b2a7945376c02fe9a (diff) |
Added new spell disable flag - core will not check if that spell exists in dbc, used for blizz deprecated items/quests
Fixed loading of access_requirement
--HG--
branch : trunk
Diffstat (limited to 'src/server/game/Conditions/DisableMgr.cpp')
-rw-r--r-- | src/server/game/Conditions/DisableMgr.cpp | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/src/server/game/Conditions/DisableMgr.cpp b/src/server/game/Conditions/DisableMgr.cpp index 3a2e186a84e..803d607b7f8 100644 --- a/src/server/game/Conditions/DisableMgr.cpp +++ b/src/server/game/Conditions/DisableMgr.cpp @@ -73,12 +73,12 @@ void DisableMgr::LoadDisables() switch (type) { case DISABLE_TYPE_SPELL: - if (!sSpellStore.LookupEntry(entry)) + if (!(sSpellStore.LookupEntry(entry) || flags & SPELL_DISABLE_DEPRECATED_SPELL)) { sLog.outErrorDb("Spell entry %u from `disables` doesn't exist in dbc, skipped.", entry); continue; } - if (!flags || flags > 7) + if (!flags || flags > 15) { sLog.outErrorDb("Disable flags for spell %u are invalid, skipped.", entry); continue; @@ -198,19 +198,24 @@ bool DisableMgr::IsDisabledFor(DisableType type, uint32 entry, Unit const* pUnit case DISABLE_TYPE_SPELL: { uint8 flags = itr->second; - if (flags & SPELL_DISABLE_PLAYER && pUnit->GetTypeId() == TYPEID_PLAYER) - return true; - else if (pUnit->GetTypeId() == TYPEID_UNIT) + if (pUnit) { - if (pUnit->ToCreature()->isPet()) + if (flags & SPELL_DISABLE_PLAYER && pUnit->GetTypeId() == TYPEID_PLAYER) + return true; + else if (pUnit->GetTypeId() == TYPEID_UNIT) { - if (flags & SPELL_DISABLE_PET) + if (pUnit->ToCreature()->isPet()) + { + if (flags & SPELL_DISABLE_PET) + return true; + } + else if (flags & SPELL_DISABLE_CREATURE) return true; } - else if (flags & SPELL_DISABLE_CREATURE) - return true; + return false; } - return false; + else if (flags & SPELL_DISABLE_DEPRECATED_SPELL) // call not from spellcast + return true; } case DISABLE_TYPE_MAP: if (!pUnit) @@ -247,8 +252,6 @@ bool DisableMgr::IsDisabledFor(DisableType type, uint32 entry, Unit const* pUnit case DISABLE_TYPE_BATTLEGROUND: case DISABLE_TYPE_ACHIEVEMENT_CRITERIA: return true; - default: - return false; } return false; |