summaryrefslogtreecommitdiff
path: root/src/net/ea/inventoryhandler.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2009-07-13 19:52:12 -0600
committerJared Adams <jaxad0127@gmail.com>2009-07-13 19:52:12 -0600
commit666211542df4fd4fb0f9a1c936b54f6405ef09ba (patch)
tree478ea55ae467406f2f90f8941a2c5bc2a74a48db /src/net/ea/inventoryhandler.cpp
parent6c764b3c95d0c078c5ccebac607517353e64dc55 (diff)
downloadmana-666211542df4fd4fb0f9a1c936b54f6405ef09ba.tar.gz
mana-666211542df4fd4fb0f9a1c936b54f6405ef09ba.tar.bz2
mana-666211542df4fd4fb0f9a1c936b54f6405ef09ba.tar.xz
mana-666211542df4fd4fb0f9a1c936b54f6405ef09ba.zip
Some item pickup cleaning
Still need to find where to attach LocalPlayer::pickedUp for TMWServ.
Diffstat (limited to 'src/net/ea/inventoryhandler.cpp')
-rw-r--r--src/net/ea/inventoryhandler.cpp39
1 files changed, 11 insertions, 28 deletions
diff --git a/src/net/ea/inventoryhandler.cpp b/src/net/ea/inventoryhandler.cpp
index c1f04661..ebea1883 100644
--- a/src/net/ea/inventoryhandler.cpp
+++ b/src/net/ea/inventoryhandler.cpp
@@ -178,42 +178,25 @@ void InventoryHandler::handleMessage(MessageIn &msg)
equipType = msg.readInt16();
itemType = msg.readInt8();
- if (msg.readInt8() > 0)
- {
- if (config.getValue("showpickupchat", 1))
- {
- localChatTab->chatLog(_("Unable to pick up item."),
- BY_SERVER);
- }
- }
- else
{
const ItemInfo &itemInfo = ItemDB::get(itemId);
- const std::string amountStr =
- // TRANSLATORS: Used as in "You picked up a ...", when
- // picking up only one item.
- (amount > 1) ? toString(amount) : _("a");
- if (config.getValue("showpickupchat", 1))
+ if (msg.readInt8() > 0)
{
- localChatTab->chatLog(strprintf(_("You picked up %s [@@%d|%s@@]."),
- amountStr.c_str(), itemInfo.getId(), itemInfo.getName().c_str()),
- BY_SERVER);
+ player_node->pickedUp(itemInfo, 0);
}
-
- if (config.getValue("showpickupparticle", 0))
+ else
{
- player_node->pickedUp(itemInfo.getName());
- }
+ player_node->pickedUp(itemInfo, amount);
- if (Item *item = inventory->getItem(index)) {
- item->setId(itemId);
- item->increaseQuantity(amount);
- } else {
- inventory->setItem(index, itemId, amount, equipType != 0);
+ if (Item *item = inventory->getItem(index)) {
+ item->setId(itemId);
+ item->increaseQuantity(amount);
+ } else {
+ inventory->setItem(index, itemId, amount, equipType != 0);
+ }
}
- }
- break;
+ } break;
case SMSG_PLAYER_INVENTORY_REMOVE:
index = msg.readInt16() - INVENTORY_OFFSET;