diff options
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/inventoryhandler.cpp | 11 |
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; |