for(int row = 0; row < spell.rows(); ++row) { int spellid = spell.getValue(row, Dbc::Spell::TaughtSpell); if(spellid == 0) spellid = spell.getValue(row, Dbc::Generic::Id); hash_map::const_iterator line( spellidtoabilityid.find(spellid)); int lineid; if(line == spellidtoabilityid.end()) { lineid = spell.getValue(row, Dbc::Spell::LineId); if(lineid == 0) continue; } else lineid = line->second;