summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2006-08-26 23:28:05 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2006-08-26 23:28:05 +0000
commitd7883e50e4475a854b85d1ae4a2bbb6d55cb0301 (patch)
tree96815c2b91e1f1f7a59eef719e6e34cecd6ca9c1 /src
parentbe3b639a879a5a8eb73b2e652683da222796af44 (diff)
downloadmana-d7883e50e4475a854b85d1ae4a2bbb6d55cb0301.tar.gz
mana-d7883e50e4475a854b85d1ae4a2bbb6d55cb0301.tar.bz2
mana-d7883e50e4475a854b85d1ae4a2bbb6d55cb0301.tar.xz
mana-d7883e50e4475a854b85d1ae4a2bbb6d55cb0301.zip
Applied patch by AHarrison that adds item pickup messages to the chat window.
Diffstat (limited to 'src')
-rw-r--r--src/net/inventoryhandler.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/net/inventoryhandler.cpp b/src/net/inventoryhandler.cpp
index 3742d327..a48ed51c 100644
--- a/src/net/inventoryhandler.cpp
+++ b/src/net/inventoryhandler.cpp
@@ -28,6 +28,7 @@
#include "messagein.h"
#include "protocol.h"
+#include "../resources/iteminfo.h"
#include "../item.h"
#include "../localplayer.h"
@@ -94,6 +95,14 @@ 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);
+ }
player_node->addInvItem(index, itemId, amount, equipType != 0);
}
break;