From a7b5a52cdecaed2b991ec061296b3989f9860199 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 6 Nov 2013 00:18:50 +0300 Subject: fix storage if select other character with opened storage. --- src/client.cpp | 2 ++ src/net/ea/inventoryhandler.cpp | 9 +++++++++ src/net/ea/inventoryhandler.h | 2 ++ src/net/inventoryhandler.h | 2 ++ 4 files changed, 15 insertions(+) (limited to 'src') diff --git a/src/client.cpp b/src/client.cpp index 272b5b1da..83395f409 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -2654,6 +2654,8 @@ void Client::closeDialogs() BuySellDialog::closeAll(); NpcDialog::closeAll(); SellDialog::closeAll(); + if (Net::getInventoryHandler()) + Net::getInventoryHandler()->closeStorage(); } bool Client::isTmw() const diff --git a/src/net/ea/inventoryhandler.cpp b/src/net/ea/inventoryhandler.cpp index be761fa19..8130eb259 100644 --- a/src/net/ea/inventoryhandler.cpp +++ b/src/net/ea/inventoryhandler.cpp @@ -587,4 +587,13 @@ void InventoryHandler::processPlayerArrowEquip(Net::MessageIn &msg) miniStatusWindow->updateArrows(); } +void InventoryHandler::closeStorage() +{ + if (mStorageWindow) + { + mStorageWindow->close(); + mStorageWindow = nullptr; + } +} + } // namespace Ea diff --git a/src/net/ea/inventoryhandler.h b/src/net/ea/inventoryhandler.h index fa0164c00..818c63061 100644 --- a/src/net/ea/inventoryhandler.h +++ b/src/net/ea/inventoryhandler.h @@ -204,6 +204,8 @@ class InventoryHandler : public Net::InventoryHandler void processPlayerArrowEquip(Net::MessageIn &msg); + void closeStorage() override final; + Inventory *getStorage() const { return mStorage; } diff --git a/src/net/inventoryhandler.h b/src/net/inventoryhandler.h index f4aa88ea0..f725a4ce5 100644 --- a/src/net/inventoryhandler.h +++ b/src/net/inventoryhandler.h @@ -69,6 +69,8 @@ class InventoryHandler virtual Inventory *getStorage() const = 0; + virtual void closeStorage() = 0; + virtual int convertFromServerSlot(const int eAthenaSlot) const = 0; }; -- cgit v1.2.3-70-g09d2