diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-10-20 12:45:11 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-10-20 12:45:11 +0300 |
commit | 12596b11b89baa167704d8cddd4599c937826062 (patch) | |
tree | 9b8c5063b97fff62e97d0bd96af680b181bf1e9e /src | |
parent | fa378412565f98a1ce6d438425ca34b20aaf223a (diff) | |
download | manaverse-12596b11b89baa167704d8cddd4599c937826062.tar.gz manaverse-12596b11b89baa167704d8cddd4599c937826062.tar.bz2 manaverse-12596b11b89baa167704d8cddd4599c937826062.tar.xz manaverse-12596b11b89baa167704d8cddd4599c937826062.zip |
eathena: add some missing pickup statuses.
Diffstat (limited to 'src')
-rw-r--r-- | src/being/localplayer.cpp | 8 | ||||
-rw-r--r-- | src/being/pickup.h | 5 | ||||
-rw-r--r-- | src/net/eathena/inventoryhandler.cpp | 28 | ||||
-rw-r--r-- | src/net/tmwa/inventoryhandler.cpp | 28 |
4 files changed, 66 insertions, 3 deletions
diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp index 74bef82b5..eb4dfae4e 100644 --- a/src/being/localplayer.cpp +++ b/src/being/localplayer.cpp @@ -844,6 +844,14 @@ void LocalPlayer::pickedUp(const ItemInfo &itemInfo, const int amount, // TRANSLATORS: pickup error message msg = N_("Item belongs to someone else."); break; + case Pickup::MAX_AMOUNT: + // TRANSLATORS: pickup error message + msg = N_("You cant pickup this amount of items."); + break; + case Pickup::STACK_AMOUNT: + // TRANSLATORS: pickup error message + msg = N_("Your item stack has max amount."); + break; default: // TRANSLATORS: pickup error message msg = N_("Unknown problem picking up item."); diff --git a/src/being/pickup.h b/src/being/pickup.h index dfa35fe20..2455d34be 100644 --- a/src/being/pickup.h +++ b/src/being/pickup.h @@ -33,12 +33,15 @@ namespace Pickup enum Type { OKAY = 0, + UNKNOWN, BAD_ITEM, TOO_HEAVY, TOO_FAR, INV_FULL, STACK_FULL, - DROP_STEAL + DROP_STEAL, + MAX_AMOUNT, + STACK_AMOUNT }; } // namespace Pickup diff --git a/src/net/eathena/inventoryhandler.cpp b/src/net/eathena/inventoryhandler.cpp index 8b75b1df9..b14bfbfb6 100644 --- a/src/net/eathena/inventoryhandler.cpp +++ b/src/net/eathena/inventoryhandler.cpp @@ -380,8 +380,34 @@ void InventoryHandler::processPlayerInventoryAdd(Net::MessageIn &msg) if (err) { + Pickup::Type pickup; + switch (err) + { + case 1: + pickup = Pickup::BAD_ITEM; + break; + case 2: + pickup = Pickup::TOO_HEAVY; + break; + case 4: + pickup = Pickup::INV_FULL; + break; + case 5: + pickup = Pickup::MAX_AMOUNT; + break; + case 6: + pickup = Pickup::TOO_FAR; + break; + case 7: + pickup = Pickup::STACK_AMOUNT; + break; + default: + pickup = Pickup::UNKNOWN; + logger->log("unknown pickup type: %d", err); + break; + } if (localPlayer) - localPlayer->pickedUp(itemInfo, 0, identified, floorId, err); + localPlayer->pickedUp(itemInfo, 0, identified, floorId, pickup); } else { diff --git a/src/net/tmwa/inventoryhandler.cpp b/src/net/tmwa/inventoryhandler.cpp index d76f4b990..6cd74da5a 100644 --- a/src/net/tmwa/inventoryhandler.cpp +++ b/src/net/tmwa/inventoryhandler.cpp @@ -319,8 +319,34 @@ void InventoryHandler::processPlayerInventoryAdd(Net::MessageIn &msg) if (err) { + Pickup::Type pickup; + switch (err) + { + case 1: + pickup = Pickup::BAD_ITEM; + break; + case 2: + pickup = Pickup::TOO_HEAVY; + break; + case 3: + pickup = Pickup::TOO_FAR; + break; + case 4: + pickup = Pickup::INV_FULL; + break; + case 5: + pickup = Pickup::STACK_FULL; + break; + case 6: + pickup = Pickup::DROP_STEAL; + break; + default: + pickup = Pickup::UNKNOWN; + logger->log("unknown pickup type: %d", err); + break; + } if (localPlayer) - localPlayer->pickedUp(itemInfo, 0, identified, floorId, err); + localPlayer->pickedUp(itemInfo, 0, identified, floorId, pickup); } else { |