diff options
author | Vincent-Michael <Vincent_Michael@gmx.de> | 2013-07-25 00:41:37 +0200 |
---|---|---|
committer | Vincent-Michael <Vincent_Michael@gmx.de> | 2013-07-25 00:41:37 +0200 |
commit | d4d43d74106bc3666175614bc7923b8b4e03bf50 (patch) | |
tree | 54940a0817cccacbc17fd82e538d17e8dd2d3ad5 /src/server/game/Globals/ObjectMgr.cpp | |
parent | ef83ec8d1c3dca2ef0208de376d0315d26d44227 (diff) | |
parent | c4a1ad2810a1c2e2c2f2e2cbf26033ac3fbdc796 (diff) |
Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
Conflicts:
src/server/game/Globals/ObjectMgr.cpp
src/server/game/Spells/SpellMgr.cpp
src/server/game/Spells/SpellMgr.h
src/server/game/World/World.cpp
Diffstat (limited to 'src/server/game/Globals/ObjectMgr.cpp')
-rw-r--r-- | src/server/game/Globals/ObjectMgr.cpp | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 55588bf9b70..f59aa1cdb71 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -4827,10 +4827,10 @@ void ObjectMgr::LoadSpellScriptNames() Field* fields = result->Fetch(); int32 spellId = fields[0].GetInt32(); - const char *scriptName = fields[1].GetCString(); + char const* scriptName = fields[1].GetCString(); bool allRanks = false; - if (spellId <= 0) + if (spellId < 0) { allRanks = true; spellId = -spellId; @@ -4839,20 +4839,18 @@ void ObjectMgr::LoadSpellScriptNames() SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId); if (!spellInfo) { - TC_LOG_ERROR(LOG_FILTER_SQL, "Scriptname:`%s` spell (spell_id:%d) does not exist in `Spell.dbc`.", scriptName, fields[0].GetInt32()); + TC_LOG_ERROR(LOG_FILTER_SQL, "Scriptname: `%s` spell (Id: %d) does not exist.", scriptName, spellId); continue; } if (allRanks) { - if (sSpellMgr->GetFirstSpellInChain(spellId) != uint32(spellId)) - { - TC_LOG_ERROR(LOG_FILTER_SQL, "Scriptname:`%s` spell (spell_id:%d) is not first rank of spell.", scriptName, fields[0].GetInt32()); - continue; - } - if (!sSpellMgr->GetNextSpellInChain(spellId)) + if (!spellInfo->IsRanked()) + TC_LOG_ERROR(LOG_FILTER_SQL, "Scriptname: `%s` spell (Id: %d) has no ranks of spell.", scriptName, fields[0].GetInt32()); + + if (spellInfo->GetFirstRankSpell()->Id != uint32(spellId)) { - TC_LOG_ERROR(LOG_FILTER_SQL, "Scriptname:`%s` spell (spell_id:%d) has no ranks of spell.", scriptName, fields[0].GetInt32()); + TC_LOG_ERROR(LOG_FILTER_SQL, "Scriptname: `%s` spell (Id: %d) is not first rank of spell.", scriptName, fields[0].GetInt32()); continue; } while (spellInfo) @@ -4862,7 +4860,13 @@ void ObjectMgr::LoadSpellScriptNames() } } else + { + if (spellInfo->IsRanked()) + TC_LOG_ERROR(LOG_FILTER_SQL, "Scriptname: `%s` spell (Id: %d) is ranked spell. Properly not all ranks are assigned to this script.", scriptName, spellId); + _spellScriptsStore.insert(SpellScriptsContainer::value_type(spellInfo->Id, GetScriptId(scriptName))); + } + ++count; } while (result->NextRow()); |