summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/actions/windows.cpp9
-rw-r--r--src/game.cpp7
-rw-r--r--src/gui/windows/inventorywindow.cpp8
3 files changed, 16 insertions, 8 deletions
diff --git a/src/actions/windows.cpp b/src/actions/windows.cpp
index cbf18125c..74f5aa071 100644
--- a/src/actions/windows.cpp
+++ b/src/actions/windows.cpp
@@ -279,6 +279,7 @@ impHandler0(bankWindowShow)
impHandler0(cartWindowShow)
{
+#ifdef EATHENA_SUPPORT
if (!serverFeatures->haveCart()
|| !localPlayer
|| !localPlayer->getHaveCart())
@@ -286,10 +287,14 @@ impHandler0(cartWindowShow)
return false;
}
-#ifdef EATHENA_SUPPORT
showHideWindow(cartWindow);
-#endif
+ if (inventoryWindow)
+ inventoryWindow->updateDropButton();
return true;
+#else
+ return false;
+#endif
+
}
impHandler0(updaterWindowShow)
diff --git a/src/game.cpp b/src/game.cpp
index 00f07d2b6..df582af9f 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -186,8 +186,11 @@ static void createGuiWindows()
inventoryWindow = new InventoryWindow(PlayerInfo::getInventory());
inventoryWindow->postInit();
#ifdef EATHENA_SUPPORT
- cartWindow = new InventoryWindow(PlayerInfo::getCartInventory());
- cartWindow->postInit();
+ if (serverFeatures->haveCart())
+ {
+ cartWindow = new InventoryWindow(PlayerInfo::getCartInventory());
+ cartWindow->postInit();
+ }
#endif
shopWindow = new ShopWindow;
shopWindow->postInit();
diff --git a/src/gui/windows/inventorywindow.cpp b/src/gui/windows/inventorywindow.cpp
index 9877bd147..5b236df21 100644
--- a/src/gui/windows/inventorywindow.cpp
+++ b/src/gui/windows/inventorywindow.cpp
@@ -415,7 +415,7 @@ void InventoryWindow::action(const ActionEvent &event)
this, item);
}
#ifdef EATHENA_SUPPORT
- else if (cartWindow)
+ else if (cartWindow && cartWindow->isWindowVisible())
{
ItemAmountWindow::showWindow(ItemAmountWindow::CartAdd,
this, item);
@@ -462,7 +462,7 @@ void InventoryWindow::action(const ActionEvent &event)
InventoryType::STORAGE);
}
#ifdef EATHENA_SUPPORT
- else if (cartWindow)
+ else if (cartWindow && cartWindow->isWindowVisible())
{
inventoryHandler->moveItem2(InventoryType::INVENTORY,
item->getInvIndex(), item->getQuantity(),
@@ -499,7 +499,7 @@ void InventoryWindow::action(const ActionEvent &event)
this, item);
}
#ifdef EATHENA_SUPPORT
- else if (cartWindow)
+ else if (cartWindow && cartWindow->isWindowVisible())
{
ItemAmountWindow::showWindow(ItemAmountWindow::CartRemove,
this, item);
@@ -851,7 +851,7 @@ void InventoryWindow::updateDropButton()
return;
#ifdef EATHENA_SUPPORT
- if (isStorageActive() || cartWindow)
+ if (isStorageActive() || (cartWindow && cartWindow->isWindowVisible()))
#else
if (isStorageActive())
#endif