diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-05-11 20:05:55 +0200 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-05-11 20:05:55 +0200 |
commit | 06115c652382d81bb25ce1dc3ad40e14f00ee273 (patch) | |
tree | d5cf275f96f4e5f6895eba5efce225ce50de3440 /src/net/tmwserv/generalhandler.cpp | |
parent | 1bb315a8d32a8c0fb95a56ca495f387be7832cfc (diff) | |
download | mana-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/net/tmwserv/generalhandler.cpp')
-rw-r--r-- | src/net/tmwserv/generalhandler.cpp | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/src/net/tmwserv/generalhandler.cpp b/src/net/tmwserv/generalhandler.cpp index 8a47e6f9..d283729d 100644 --- a/src/net/tmwserv/generalhandler.cpp +++ b/src/net/tmwserv/generalhandler.cpp @@ -52,8 +52,6 @@ Net::Connection *gameServerConnection = 0; Net::Connection *chatServerConnection = 0; Net::Connection *accountServerConnection = 0; -std::list<ItemDB::Stat*> stats; - namespace TmwServ { GeneralHandler::GeneralHandler(): @@ -79,19 +77,13 @@ GeneralHandler::GeneralHandler(): generalHandler = this; - ItemDB::Stat stat; - stat.tag = "str"; stat.format = N_("Strength: %d"); - stats.push_back(&stat); - stat.tag = "agi"; stat.format = N_("Agility: %d"); - stats.push_back(&stat); - stat.tag = "dex"; stat.format = N_("Dexterity: %d"); - stats.push_back(&stat); - stat.tag = "vit"; stat.format = N_("Vitality: %d"); - stats.push_back(&stat); - stat.tag = "int"; stat.format = N_("Intelligence: %d"); - stats.push_back(&stat); - stat.tag = "will"; stat.format = N_("Willpower: %d"); - stats.push_back(&stat); + std::list<ItemDB::Stat> stats; + stats.push_back(ItemDB::Stat("str", N_("Strength: %d"))); + stats.push_back(ItemDB::Stat("agi", N_("Agility: %d"))); + stats.push_back(ItemDB::Stat("dex", N_("Dexterity: %d"))); + stats.push_back(ItemDB::Stat("vit", N_("Vitality: %d"))); + stats.push_back(ItemDB::Stat("int", N_("Intelligence: %d"))); + stats.push_back(ItemDB::Stat("will", N_("Willpower: %d"))); ItemDB::setStatsList(stats); } |