diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-12-17 20:23:35 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-12-17 20:23:35 +0300 |
commit | 97240b75d2bdd19a0d98b52d978938be9d984478 (patch) | |
tree | bdb13fbfb8e7088fc0298470b951530e0cffc8bb | |
parent | e5ca9fbefd9a680b958a957f0fe01f93293bcd39 (diff) | |
download | plus-97240b75d2bdd19a0d98b52d978938be9d984478.tar.gz plus-97240b75d2bdd19a0d98b52d978938be9d984478.tar.bz2 plus-97240b75d2bdd19a0d98b52d978938be9d984478.tar.xz plus-97240b75d2bdd19a0d98b52d978938be9d984478.zip |
On using eggs, if present only one egg in invenory, auto hatch it.
-rw-r--r-- | src/net/eathena/pethandler.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/net/eathena/pethandler.cpp b/src/net/eathena/pethandler.cpp index f04d1e8fc..41b69550c 100644 --- a/src/net/eathena/pethandler.cpp +++ b/src/net/eathena/pethandler.cpp @@ -35,6 +35,7 @@ #include "gui/widgets/tabs/chat/chattab.h" #include "net/chathandler.h" +#include "net/inventoryhandler.h" #include "net/ea/eaprotocol.h" @@ -195,11 +196,18 @@ void PetHandler::processPetRoulette(Net::MessageIn &msg) void PetHandler::processEggsList(Net::MessageIn &msg) { const int count = (msg.readInt16("len") - 4) / 2; + Inventory *const inv = PlayerInfo::getInventory(); menu = MenuType::Eggs; + if (count == 1) + { + const int index = msg.readInt16("index") - INVENTORY_OFFSET; + const Item *const item = inv->getItem(index); + inventoryHandler->selectEgg(item); + return; + } SellDialog *const dialog = new EggSelectionDialog; dialog->postInit(); - Inventory *const inv = PlayerInfo::getInventory(); for (int f = 0; f < count; f ++) { |