diff options
| author | Nay <dnpd.dd@gmail.com> | 2013-08-24 22:56:29 +0100 |
|---|---|---|
| committer | Nay <dnpd.dd@gmail.com> | 2013-08-24 22:57:22 +0100 |
| commit | 12973de799dde8f89b9049964e26ab63a960520a (patch) | |
| tree | 2f1d0c6346c71f1c9543aa9fb497af3d12053249 /src/server/game/Spells/SpellMgr.cpp | |
| parent | 61016dcc66eaeef26dd21d3f5cf7323809a76080 (diff) | |
Core&Tools: Fix multiple issues found by a static code coverage tool
Diffstat (limited to 'src/server/game/Spells/SpellMgr.cpp')
| -rw-r--r-- | src/server/game/Spells/SpellMgr.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index ebf7121eb54..e42d0f40998 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -1236,7 +1236,7 @@ void SpellMgr::LoadSpellTalentRanks() node.rank = rank + 1; node.prev = prevSpell; - node.next = node.rank < MAX_TALENT_RANK ? GetSpellInfo(talentInfo->RankID[rank + 1]) : NULL; + node.next = node.rank < MAX_TALENT_RANK ? GetSpellInfo(talentInfo->RankID[node.rank]) : NULL; mSpellChains[spellId] = node; mSpellInfoMap[spellId]->ChainEntry = &mSpellChains[spellId]; @@ -2782,6 +2782,9 @@ void SpellMgr::LoadSpellInfoCustomAttributes() { uint32 enchantId = spellInfo->Effects[j].MiscValue; SpellItemEnchantmentEntry const* enchant = sSpellItemEnchantmentStore.LookupEntry(enchantId); + if (!enchant) + break; + for (uint8 s = 0; s < MAX_ITEM_ENCHANTMENT_EFFECTS; ++s) { if (enchant->type[s] != ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL) @@ -3769,10 +3772,10 @@ void SpellMgr::LoadSpellInfoCorrections() } } - SummonPropertiesEntry* properties = const_cast<SummonPropertiesEntry*>(sSummonPropertiesStore.LookupEntry(121)); - properties->Type = SUMMON_TYPE_TOTEM; - properties = const_cast<SummonPropertiesEntry*>(sSummonPropertiesStore.LookupEntry(647)); // 52893 - properties->Type = SUMMON_TYPE_TOTEM; + if (SummonPropertiesEntry* properties = const_cast<SummonPropertiesEntry*>(sSummonPropertiesStore.LookupEntry(121))) + properties->Type = SUMMON_TYPE_TOTEM; + if (SummonPropertiesEntry* properties = const_cast<SummonPropertiesEntry*>(sSummonPropertiesStore.LookupEntry(647))) // 52893 + properties->Type = SUMMON_TYPE_TOTEM; TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, ">> Loaded SpellInfo corrections in %u ms", GetMSTimeDiffToNow(oldMSTime)); } |
