diff options
author | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-08-22 17:58:31 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-08-25 22:09:32 +0200 |
commit | 221d67c4774bf41e6f2f0f73fb6914030e33bdde (patch) | |
tree | 6fbb4de64d172c196ed617176d5346dd4d774c49 /src/playerinfo.cpp | |
parent | 9e313b385bae45a88338a2dbfb008af7a9e38e7a (diff) | |
download | mana-221d67c4774bf41e6f2f0f73fb6914030e33bdde.tar.gz mana-221d67c4774bf41e6f2f0f73fb6914030e33bdde.tar.bz2 mana-221d67c4774bf41e6f2f0f73fb6914030e33bdde.tar.xz mana-221d67c4774bf41e6f2f0f73fb6914030e33bdde.zip |
Fixed initialization of equipment backend
For new characters (and in general, when logging in with a character
that had nothing equipped), the equipment backend wasn't being
initialized. This resulted in the equipment not being visible in the
Equipment window.
Fixes #83
Diffstat (limited to 'src/playerinfo.cpp')
-rw-r--r-- | src/playerinfo.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/playerinfo.cpp b/src/playerinfo.cpp index 433f4f6b..4d5074ee 100644 --- a/src/playerinfo.cpp +++ b/src/playerinfo.cpp @@ -27,6 +27,9 @@ #include "eventlistener.h" #include "log.h" +#include "net/inventoryhandler.h" +#include "net/net.h" + namespace PlayerInfo { class PlayerLogic; @@ -193,11 +196,6 @@ Item *getEquipment(unsigned int slot) return mEquipment->getEquipment(slot); } -void setEquipmentBackend(Equipment::Backend *backend) -{ - mEquipment->setBackend(backend); -} - int getStorageCount() { return mStorageCount; @@ -351,7 +349,7 @@ public: if (mInventory == nullptr) { mInventory = new Inventory(Inventory::INVENTORY); - mEquipment = new Equipment(); + mEquipment = new Equipment(Net::getInventoryHandler()->getEquipmentBackend()); } } } |