summaryrefslogtreecommitdiff
path: root/src/playerinfo.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-11-08 00:44:17 +0300
committerAndrei Karas <akaras@inbox.ru>2011-11-08 00:44:17 +0300
commit4cea2a5cd85b8d3ad905eb3b337b28284c62d4fe (patch)
tree714897eca03fbcb764f5b450a29cc1aef8d33433 /src/playerinfo.cpp
parent9e83411f7e4147d09af5a5006888dcc187ea0ef8 (diff)
downloadmv-4cea2a5cd85b8d3ad905eb3b337b28284c62d4fe.tar.gz
mv-4cea2a5cd85b8d3ad905eb3b337b28284c62d4fe.tar.bz2
mv-4cea2a5cd85b8d3ad905eb3b337b28284c62d4fe.tar.xz
mv-4cea2a5cd85b8d3ad905eb3b337b28284c62d4fe.zip
Fix more gcc 4.7 warnings.
Diffstat (limited to 'src/playerinfo.cpp')
-rw-r--r--src/playerinfo.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/playerinfo.cpp b/src/playerinfo.cpp
index e0f8aa494..93e704302 100644
--- a/src/playerinfo.cpp
+++ b/src/playerinfo.cpp
@@ -41,13 +41,13 @@ namespace PlayerInfo
class PlayerInfoListener;
-PlayerInfoListener *mListener = 0;
+PlayerInfoListener *mListener = nullptr;
PlayerInfoBackend mData;
int mCharId = 0;
-Inventory *mInventory = 0;
-Equipment *mEquipment = 0;
+Inventory *mInventory = nullptr;
+Equipment *mEquipment = nullptr;
std::map<int, Special> mSpecials;
char mSpecialRechargeUpdateNeeded = 0;
@@ -210,7 +210,7 @@ Item *getEquipment(unsigned int slot)
if (mEquipment)
return mEquipment->getEquipment(slot);
else
- return 0;
+ return nullptr;
}
void setEquipmentBackend(Equipment::Backend *backend)
@@ -322,7 +322,7 @@ public:
if (newState == STATE_GAME)
{
- if (mInventory == 0)
+ if (!mInventory)
{
mInventory = new Inventory(Inventory::INVENTORY);
mEquipment = new Equipment();
@@ -335,10 +335,9 @@ public:
if (event.getName() == Mana::EVENT_DESTRUCTED)
{
delete mInventory;
+ mInventory = nullptr;
delete mEquipment;
-
- mInventory = 0;
- mEquipment = 0;
+ mEquipment = nullptr;
}
}
}
@@ -356,7 +355,7 @@ void init()
void deinit()
{
delete mListener;
- mListener = 0;
+ mListener = nullptr;
}
} // namespace PlayerInfo