Skip to content

Commit

Permalink
Fixed crash when logging into debug build (#2571)
Browse files Browse the repository at this point in the history
Fix #2572
  • Loading branch information
Costallat authored May 6, 2021
1 parent 23e2e93 commit 7adf72a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/creatures/combat/spells.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,12 +205,19 @@ bool Spells::registerRuneLuaEvent(RuneSpell* event)
std::list<uint16_t> Spells::getSpellsByVocation(uint16_t vocationId)
{
std::list<uint16_t> spellsList;
VocSpellMap vocSpells;
std::map<uint16_t, bool>::const_iterator vocSpellsIt;

for (const auto& it : instants) {
VocSpellMap map = it.second.getVocMap();
if (map.find(vocationId)->second) {
vocSpells = it.second.getVocMap();
vocSpellsIt = vocSpells.find(vocationId);

if (vocSpellsIt != vocSpells.end()
&& vocSpellsIt->second) {
spellsList.push_back(it.second.getId());
}
}

return spellsList;
}

Expand Down

0 comments on commit 7adf72a

Please sign in to comment.