summaryrefslogtreecommitdiff
path: root/src/net/ea
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-04-22 21:54:59 +0300
committerAndrei Karas <akaras@inbox.ru>2014-04-22 21:54:59 +0300
commitbcd95847a435bb3aab90bdb3c2fdada6063efc2e (patch)
tree9a9cb19d2cec9c73d3b8c9eaeb4c781b0ac48642 /src/net/ea
parentff6c93b16f408a2ef10e47a4168c59ab6c4fdafb (diff)
downloadplus-bcd95847a435bb3aab90bdb3c2fdada6063efc2e.tar.gz
plus-bcd95847a435bb3aab90bdb3c2fdada6063efc2e.tar.bz2
plus-bcd95847a435bb3aab90bdb3c2fdada6063efc2e.tar.xz
plus-bcd95847a435bb3aab90bdb3c2fdada6063efc2e.zip
Fix crash if start trade with opened storage.
Diffstat (limited to 'src/net/ea')
-rw-r--r--src/net/ea/inventoryhandler.cpp11
-rw-r--r--src/net/ea/inventoryhandler.h2
2 files changed, 13 insertions, 0 deletions
diff --git a/src/net/ea/inventoryhandler.cpp b/src/net/ea/inventoryhandler.cpp
index f3c8040e1..ea7390ccb 100644
--- a/src/net/ea/inventoryhandler.cpp
+++ b/src/net/ea/inventoryhandler.cpp
@@ -486,6 +486,11 @@ void InventoryHandler::processPlayerStorageClose(Net::MessageIn &msg A_UNUSED)
{
// Storage access has been closed
// Storage window deletes itself
+ if (mStorageWindow)
+ {
+ mStorageWindow->unsetInventory();
+ mStorageWindow->close();
+ }
mStorageWindow = nullptr;
if (mStorage)
@@ -592,9 +597,15 @@ void InventoryHandler::closeStorage()
{
if (mStorageWindow)
{
+ mStorageWindow->unsetInventory();
mStorageWindow->close();
mStorageWindow = nullptr;
}
}
+void InventoryHandler::forgotStorage()
+{
+ mStorageWindow = nullptr;
+}
+
} // namespace Ea
diff --git a/src/net/ea/inventoryhandler.h b/src/net/ea/inventoryhandler.h
index ac88c1d6c..4546b75bb 100644
--- a/src/net/ea/inventoryhandler.h
+++ b/src/net/ea/inventoryhandler.h
@@ -210,6 +210,8 @@ class InventoryHandler : public Net::InventoryHandler
void closeStorage() override final;
+ void forgotStorage() override final;
+
Inventory *getStorage() const
{ return mStorage; }