diff options
author | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2007-01-03 22:34:40 +0000 |
---|---|---|
committer | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2007-01-03 22:34:40 +0000 |
commit | 36eb5ac7f856dc83242837738eb18cfd9039352f (patch) | |
tree | 89ebfae081d2207e68dc04b52e4558b3a316834f /src/game-server/itemmanager.cpp | |
parent | 282ca19e33b79f4468ce6402406ddb1397f2d115 (diff) | |
download | manaserv-36eb5ac7f856dc83242837738eb18cfd9039352f.tar.gz manaserv-36eb5ac7f856dc83242837738eb18cfd9039352f.tar.bz2 manaserv-36eb5ac7f856dc83242837738eb18cfd9039352f.tar.xz manaserv-36eb5ac7f856dc83242837738eb18cfd9039352f.zip |
Added a Xmas cake: the server now supports items on floor.
Diffstat (limited to 'src/game-server/itemmanager.cpp')
-rw-r--r-- | src/game-server/itemmanager.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/game-server/itemmanager.cpp b/src/game-server/itemmanager.cpp index f4a5b751..08adb9de 100644 --- a/src/game-server/itemmanager.cpp +++ b/src/game-server/itemmanager.cpp @@ -101,7 +101,7 @@ ItemManager::ItemManager(std::string const &itemReferenceFile) modifiers.weaponType = XML::getProperty(node, "weapon_type", 0); modifiers.beingStateEffect = XML::getProperty(node, "status_effect", 0); - ItemClass *item = new ItemClass(itemType); + ItemClass *item = new ItemClass(id, itemType); item->setWeight(weight); item->setCost(value); item->setMaxPerSlot(maxPerSlot); @@ -157,3 +157,9 @@ ItemManager::ItemManager(std::string const &itemReferenceFile) xmlFreeDoc(doc); } + +ItemClass *ItemManager::getItem(int itemId) const +{ + std::map< int, ItemClass * >::const_iterator i = mItemReference.find(itemId); + return i != mItemReference.end() ? i->second : NULL; +} |