summaryrefslogtreecommitdiff
path: root/src/net/manaserv
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/manaserv')
-rw-r--r--src/net/manaserv/connection.cpp3
-rw-r--r--src/net/manaserv/connection.h6
-rw-r--r--src/net/manaserv/inventoryhandler.h21
3 files changed, 10 insertions, 20 deletions
diff --git a/src/net/manaserv/connection.cpp b/src/net/manaserv/connection.cpp
index 4bc57695..d439f964 100644
--- a/src/net/manaserv/connection.cpp
+++ b/src/net/manaserv/connection.cpp
@@ -32,9 +32,8 @@ namespace ManaServ
{
Connection::Connection(ENetHost *client):
- mConnection(nullptr), mClient(client)
+ mClient(client)
{
- mPort = 0;
connections++;
}
diff --git a/src/net/manaserv/connection.h b/src/net/manaserv/connection.h
index 42932c47..e6646e0e 100644
--- a/src/net/manaserv/connection.h
+++ b/src/net/manaserv/connection.h
@@ -72,10 +72,10 @@ namespace ManaServ
friend Connection *ManaServ::getConnection();
Connection(ENetHost *client);
- short mPort;
- ENetPeer *mConnection;
+ short mPort = 0;
+ ENetPeer *mConnection = nullptr;
ENetHost *mClient;
- State mState;
+ State mState = OK;
};
}
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;