From d7883e50e4475a854b85d1ae4a2bbb6d55cb0301 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Sat, 26 Aug 2006 23:28:05 +0000 Subject: Applied patch by AHarrison that adds item pickup messages to the chat window. --- src/net/inventoryhandler.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/net') 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; -- cgit v1.2.3-70-g09d2