summaryrefslogtreecommitdiff
path: root/src/resources/itemdb.h
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.h
parent1bb315a8d32a8c0fb95a56ca495f387be7832cfc (diff)
downloadMana-06115c652382d81bb25ce1dc3ad40e14f00ee273.tar.gz
Mana-06115c652382d81bb25ce1dc3ad40e14f00ee273.tar.bz2
Mana-06115c652382d81bb25ce1dc3ad40e14f00ee273.tar.xz
Mana-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.h')
-rw-r--r--src/resources/itemdb.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/resources/itemdb.h b/src/resources/itemdb.h
index 2bb8fd5e..d0964e49 100644
--- a/src/resources/itemdb.h
+++ b/src/resources/itemdb.h
@@ -46,12 +46,19 @@ namespace ItemDB
const ItemInfo &get(int id);
const ItemInfo &get(const std::string &name);
- struct Stat {
+ struct Stat
+ {
+ Stat(const std::string &tag,
+ const std::string &format):
+ tag(tag),
+ format(format)
+ {}
+
std::string tag;
std::string format;
};
- void setStatsList(std::list<Stat*> stats);
+ void setStatsList(const std::list<Stat> &stats);
// Items database
typedef std::map<int, ItemInfo*> ItemInfos;