summaryrefslogtreecommitdiff
path: root/src/gui/windows/questswindow.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-05-29 17:45:52 +0300
committerAndrei Karas <akaras@inbox.ru>2015-05-29 17:45:52 +0300
commit2d32dc27210d16102f9200de115f2c3f79a5cb22 (patch)
tree5aa84ebe6c5c1d708b14bee2bf0ce95df714fc1d /src/gui/windows/questswindow.cpp
parent7bdb50605562e47f1d6ae134881c09bd42293be5 (diff)
downloadplus-2d32dc27210d16102f9200de115f2c3f79a5cb22.tar.gz
plus-2d32dc27210d16102f9200de115f2c3f79a5cb22.tar.bz2
plus-2d32dc27210d16102f9200de115f2c3f79a5cb22.tar.xz
plus-2d32dc27210d16102f9200de115f2c3f79a5cb22.zip
Use BeingTypeId in Being for subtypeid.
Diffstat (limited to 'src/gui/windows/questswindow.cpp')
-rw-r--r--src/gui/windows/questswindow.cpp16
1 files changed, 8 insertions, 8 deletions
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<int> removeEffects;
- std::map<int, int> addEffects;
+ std::set<BeingTypeId> removeEffects;
+ std::map<BeingTypeId, int> 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<int, const QuestEffect*>::const_iterator
+ const BeingTypeId id = being->getSubType();
+ const std::map<BeingTypeId, const QuestEffect*>::const_iterator
it = mNpcEffects.find(id);
if (it != mNpcEffects.end())
{