summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2006-09-03 15:00:47 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2006-09-03 15:00:47 +0000
commit77efbb50066a030d1f44f8de8d06ace9f284e3a2 (patch)
tree22d737ac0058e4fa87e7767d41e02999bcbf84be /src/net
parent40ca3dc75197412594c5f6a78d68b265e235024b (diff)
downloadmana-77efbb50066a030d1f44f8de8d06ace9f284e3a2.tar.gz
mana-77efbb50066a030d1f44f8de8d06ace9f284e3a2.tar.bz2
mana-77efbb50066a030d1f44f8de8d06ace9f284e3a2.tar.xz
mana-77efbb50066a030d1f44f8de8d06ace9f284e3a2.zip
Introduced SelectionListener to fix updating problem in inventory window
(should also be used to fix similar problem in trade, buy and sell dialogs). Made the ItemInfo be passed around as a reference instead of a pointer, since it is never NULL.
Diffstat (limited to 'src/net')
-rw-r--r--src/net/inventoryhandler.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/net/inventoryhandler.cpp b/src/net/inventoryhandler.cpp
index a48ed51c..afe653eb 100644
--- a/src/net/inventoryhandler.cpp
+++ b/src/net/inventoryhandler.cpp
@@ -95,14 +95,9 @@ void InventoryHandler::handleMessage(MessageIn *msg)
if (msg->readInt8()> 0) {
chatWindow->chatLog("Unable to pick up item", BY_SERVER);
} else {
- ItemInfo *itemInfo = itemDb->getItemInfo(itemId);
- if (itemInfo) {
- chatWindow->chatLog("You picked up a " +
- itemInfo->getName(), BY_SERVER);
- } else {
- chatWindow->chatLog("You picked up an unknown item",
- BY_SERVER);
- }
+ const ItemInfo &itemInfo = itemDb->getItemInfo(itemId);
+ chatWindow->chatLog("You picked up a " +
+ itemInfo.getName(), BY_SERVER);
player_node->addInvItem(index, itemId, amount, equipType != 0);
}
break;