diff options
author | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-02-08 22:35:09 +0100 |
---|---|---|
committer | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-02-09 17:14:25 +0100 |
commit | 1b041ecccfbe44a4f50ffc086e3996e2b6eea4f7 (patch) | |
tree | 74cff7036d1ecfb4df5a79a7ca68bedce5bea47e /src/net/manaserv/inventoryhandler.h | |
parent | 0ca05c54dd814f294617eda286ef175f01baa542 (diff) | |
download | mana-1b041ecccfbe44a4f50ffc086e3996e2b6eea4f7.tar.gz mana-1b041ecccfbe44a4f50ffc086e3996e2b6eea4f7.tar.bz2 mana-1b041ecccfbe44a4f50ffc086e3996e2b6eea4f7.tar.xz mana-1b041ecccfbe44a4f50ffc086e3996e2b6eea4f7.zip |
C++11: Use default member initializers
This patch is not exhaustive.
Diffstat (limited to 'src/net/manaserv/inventoryhandler.h')
-rw-r--r-- | src/net/manaserv/inventoryhandler.h | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/src/net/manaserv/inventoryhandler.h b/src/net/manaserv/inventoryhandler.h index 3659286b..7ed1b9d5 100644 --- a/src/net/manaserv/inventoryhandler.h +++ b/src/net/manaserv/inventoryhandler.h @@ -71,43 +71,34 @@ class EquipBackend : public Equipment::Backend, public EventListener void readBoxNode(xmlNodePtr slotNode); struct Slot { - Slot(): - item(nullptr), - slotTypeId(0), - subId(0), - itemInstance(0), - weaponSlot(false), - ammoSlot(false) - {} - // Generic info std::string name; // The Item reference, used for graphical representation // and info. - Item *item; + Item *item = nullptr; // Manaserv specific info // Used to know which (server-side) slot id it is. - unsigned int slotTypeId; + unsigned int slotTypeId = 0; // Static part // The sub id is used to know in which order the slots are // when the slotType has more than one slot capacity: // I.e.: capacity = 6, subId will be between 1 and 6 // for each slots in the map. // This is used to sort the multimap along with the slot id. - unsigned int subId; + unsigned int subId = 0; // This is the (per character) unique item Id, used especially when // equipping the same item multiple times on the same slot type. - unsigned int itemInstance; + unsigned int itemInstance = 0; // Tell whether the slot is a weapon slot - bool weaponSlot; + bool weaponSlot = false; // Tell whether the slot is an ammo slot - bool ammoSlot; + bool ammoSlot = false; }; unsigned int mVisibleSlots; |