From 0b10f0318b9f9ab308f04712698aa104bec21e29 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Thu, 17 Feb 2011 20:32:49 -0800 Subject: Specific messages for each pickup failure reason. Reviewed-by: Jaxad0127 Manaplus: fix code style and add some checks. --- src/net/tmwa/inventoryhandler.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/net') diff --git a/src/net/tmwa/inventoryhandler.cpp b/src/net/tmwa/inventoryhandler.cpp index 7c6da139e..27e44b70c 100644 --- a/src/net/tmwa/inventoryhandler.cpp +++ b/src/net/tmwa/inventoryhandler.cpp @@ -280,15 +280,16 @@ void InventoryHandler::handleMessage(Net::MessageIn &msg) { const ItemInfo &itemInfo = ItemDB::get(itemId); - if (msg.readInt8() > 0) + unsigned char err = msg.readInt8(); + if (err) { if (player_node) - player_node->pickedUp(itemInfo, 0); + player_node->pickedUp(itemInfo, 0, err); } else { if (player_node) - player_node->pickedUp(itemInfo, amount); + player_node->pickedUp(itemInfo, amount, PICKUP_OKAY); if (inventory) { -- cgit v1.2.3-70-g09d2