From 2d32dc27210d16102f9200de115f2c3f79a5cb22 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 29 May 2015 17:45:52 +0300 Subject: Use BeingTypeId in Being for subtypeid. --- src/gui/windows/questswindow.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/gui/windows/questswindow.cpp') diff --git a/src/gui/windows/questswindow.cpp b/src/gui/windows/questswindow.cpp index 9279220ac..608d84954 100644 --- a/src/gui/windows/questswindow.cpp +++ b/src/gui/windows/questswindow.cpp @@ -245,12 +245,12 @@ void QuestsWindow::loadEffect(const int var, const XmlNodePtr node) { QuestEffect *const effect = new QuestEffect; effect->map = XML::getProperty(node, "map", ""); - effect->id = XML::getProperty(node, "npc", -1); + effect->id = fromInt(XML::getProperty(node, "npc", -1), BeingTypeId); effect->effectId = XML::getProperty(node, "effect", -1); const std::string values = XML::getProperty(node, "value", ""); splitToIntSet(effect->values, values, ','); - if (effect->map.empty() || effect->id == -1 + if (effect->map.empty() || effect->id == BeingTypeId_negOne || effect->effectId == -1 || values.empty()) { delete effect; @@ -465,13 +465,13 @@ void QuestsWindow::updateEffects() if (!actorManager) return; - std::set removeEffects; - std::map addEffects; + std::set removeEffects; + std::map addEffects; // for old effects FOR_EACH (NpcQuestEffectMapCIter, it, oldNpc) { - const int id = (*it).first; + const BeingTypeId id = (*it).first; const QuestEffect *const effect = (*it).second; const NpcQuestEffectMapCIter itNew = mNpcEffects.find(id); @@ -493,7 +493,7 @@ void QuestsWindow::updateEffects() // for new effects FOR_EACH (NpcQuestEffectMapCIter, it, mNpcEffects) { - const int id = (*it).first; + const BeingTypeId id = (*it).first; const QuestEffect *const effect = (*it).second; const NpcQuestEffectMapCIter itNew = oldNpc.find(id); @@ -509,8 +509,8 @@ void QuestsWindow::addEffect(Being *const being) { if (!being) return; - const int id = being->getSubType(); - const std::map::const_iterator + const BeingTypeId id = being->getSubType(); + const std::map::const_iterator it = mNpcEffects.find(id); if (it != mNpcEffects.end()) { -- cgit v1.2.3-60-g2f50