From 57effc876dba0ef2acc3e6b8d034b394a63d796a Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 13 Jan 2011 20:17:58 +0200 Subject: Fix invisible equipment in equipment window (F4) issue. --- src/equipment.h | 3 +++ src/net/tmwa/inventoryhandler.cpp | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/src/equipment.h b/src/equipment.h index 24f7174fd..e04ae486b 100644 --- a/src/equipment.h +++ b/src/equipment.h @@ -87,6 +87,9 @@ class Equipment void setBackend(Backend *backend) { mBackend = backend; } + Backend *getBackend() + { return mBackend; } + private: Backend *mBackend; }; diff --git a/src/net/tmwa/inventoryhandler.cpp b/src/net/tmwa/inventoryhandler.cpp index 3cc0e9ce0..23a1e78b1 100644 --- a/src/net/tmwa/inventoryhandler.cpp +++ b/src/net/tmwa/inventoryhandler.cpp @@ -426,6 +426,11 @@ void InventoryHandler::handleMessage(Net::MessageIn &msg) case SMSG_PLAYER_EQUIPMENT: msg.readInt16(); // length + if (!PlayerInfo::getEquipment()->getBackend()) + { // look like SMSG_PLAYER_INVENTORY was not received + mEquips.clear(); + PlayerInfo::getEquipment()->setBackend(&mEquips); + } number = (msg.getLength() - 4) / 20; for (int loop = 0; loop < number; loop++) -- cgit v1.2.3-70-g09d2