summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
Diffstat (limited to 'src/net')
-rw-r--r--src/net/ea/buysellhandler.cpp1
-rw-r--r--src/net/eathena/pethandler.cpp18
2 files changed, 18 insertions, 1 deletions
diff --git a/src/net/ea/buysellhandler.cpp b/src/net/ea/buysellhandler.cpp
index fe2f7ffe0..b28681cb9 100644
--- a/src/net/ea/buysellhandler.cpp
+++ b/src/net/ea/buysellhandler.cpp
@@ -147,6 +147,7 @@ void BuySellHandler::processNpcSell(Net::MessageIn &msg) const
if (n_items > 0)
{
SellDialog *const dialog = new NpcSellDialog(mNpcId);
+ dialog->postInit();
dialog->setMoney(PlayerInfo::getAttribute(Attributes::MONEY));
for (int k = 0; k < n_items; k++)
diff --git a/src/net/eathena/pethandler.cpp b/src/net/eathena/pethandler.cpp
index bb513b6ac..9b2f3b22b 100644
--- a/src/net/eathena/pethandler.cpp
+++ b/src/net/eathena/pethandler.cpp
@@ -20,13 +20,20 @@
#include "net/eathena/pethandler.h"
+#include "inventory.h"
#include "notifymanager.h"
+#include "being/playerinfo.h"
+
#include "gui/chatconsts.h"
+#include "gui/windows/eggselectiondialog.h"
+
#include "net/chathandler.h"
#include "net/net.h"
+#include "net/ea/eaprotocol.h"
+
#include "net/eathena/menu.h"
#include "net/eathena/messageout.h"
#include "net/eathena/protocol.h"
@@ -149,9 +156,18 @@ void PetHandler::processEggsList(Net::MessageIn &msg)
{
const int count = (msg.readInt16("len") - 4) / 2;
menu = MenuType::Eggs;
+
+ SellDialog *const dialog = new EggSelectionDialog;
+ dialog->postInit();
+ Inventory *const inv = PlayerInfo::getInventory();
+
for (int f = 0; f < count; f ++)
{
- msg.readInt16("egg index");
+ const int index = msg.readInt16("index") - INVENTORY_OFFSET;
+ const Item *const item = inv->getItem(index);
+
+ if (item)
+ dialog->addItem(item, 0);
}
}