summaryrefslogtreecommitdiff
path: root/src/resources/itemdb.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2009-05-11 20:05:55 +0200
committerBjørn Lindeijer <bjorn@lindeijer.nl>2009-05-11 20:05:55 +0200
commit06115c652382d81bb25ce1dc3ad40e14f00ee273 (patch)
treed5cf275f96f4e5f6895eba5efce225ce50de3440 /src/resources/itemdb.cpp
parent1bb315a8d32a8c0fb95a56ca495f387be7832cfc (diff)
downloadmana-client-06115c652382d81bb25ce1dc3ad40e14f00ee273.tar.gz
mana-client-06115c652382d81bb25ce1dc3ad40e14f00ee273.tar.bz2
mana-client-06115c652382d81bb25ce1dc3ad40e14f00ee273.tar.xz
mana-client-06115c652382d81bb25ce1dc3ad40e14f00ee273.zip
Fixed the memory issues with the pointers to item stat modifiers
It was a list of pointers to Stat instances that had long been popped off the stack and deleted.
Diffstat (limited to 'src/resources/itemdb.cpp')
-rw-r--r--src/resources/itemdb.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/resources/itemdb.cpp b/src/resources/itemdb.cpp
index 66c07849..99907ca7 100644
--- a/src/resources/itemdb.cpp
+++ b/src/resources/itemdb.cpp
@@ -55,9 +55,9 @@ static char const *const fields[][2] =
{ "mp", N_("MP %+d") }
};
-static std::list<ItemDB::Stat*> extraStats;
+static std::list<ItemDB::Stat> extraStats;
-void ItemDB::setStatsList(std::list<ItemDB::Stat*> stats)
+void ItemDB::setStatsList(const std::list<ItemDB::Stat> &stats)
{
extraStats = stats;
}
@@ -163,13 +163,13 @@ void ItemDB::load()
if (!effect.empty()) effect += " / ";
effect += strprintf(gettext(fields[i][1]), value);
}
- for (std::list<Stat*>::iterator it = extraStats.begin();
+ for (std::list<Stat>::iterator it = extraStats.begin();
it != extraStats.end(); it++)
{
- int value = XML::getProperty(node, (*it)->tag.c_str(), 0);
+ int value = XML::getProperty(node, it->tag.c_str(), 0);
if (!value) continue;
if (!effect.empty()) effect += " / ";
- effect += strprintf((*it)->format.c_str(), value);
+ effect += strprintf(it->format.c_str(), value);
}
std::string temp = XML::getProperty(node, "effect", "");
if (!effect.empty() && !temp.empty())