summaryrefslogtreecommitdiff
path: root/src/playerinfo.cpp
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-01-26 16:07:54 +0100
committerThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-01-26 16:07:54 +0100
commit5afe88df2538274859a162ffd63ed52118e80c19 (patch)
treeb610dfd58dc748fd63f49565b2a43eea2316714f /src/playerinfo.cpp
parent73ba2a95f5bd4a0dd09af52d5864800be2b0a4c6 (diff)
downloadmana-5afe88df2538274859a162ffd63ed52118e80c19.tar.gz
mana-5afe88df2538274859a162ffd63ed52118e80c19.tar.bz2
mana-5afe88df2538274859a162ffd63ed52118e80c19.tar.xz
mana-5afe88df2538274859a162ffd63ed52118e80c19.zip
Apply C++11 fixits
modernize-use-auto modernize-use-nullptr modernize-use-override modernize-use-using
Diffstat (limited to 'src/playerinfo.cpp')
-rw-r--r--src/playerinfo.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/playerinfo.cpp b/src/playerinfo.cpp
index 03c48340..22c01516 100644
--- a/src/playerinfo.cpp
+++ b/src/playerinfo.cpp
@@ -33,12 +33,12 @@ namespace PlayerInfo {
class PlayerLogic;
-static PlayerLogic *mListener = 0;
+static PlayerLogic *mListener = nullptr;
static PlayerInfoBackend mData;
-static Inventory *mInventory = 0;
-static Equipment *mEquipment = 0;
+static Inventory *mInventory = nullptr;
+static Equipment *mEquipment = nullptr;
static bool mStorageCount = 0;
@@ -63,7 +63,7 @@ void triggerAttr(int id, int old)
void triggerStat(int id, const std::string &changed, int old1, int old2 = 0)
{
- StatMap::iterator it = mData.mStats.find(id);
+ auto it = mData.mStats.find(id);
Event event(Event::UpdateStat);
event.setInt("id", id);
event.setInt("base", it->second.base);
@@ -319,7 +319,7 @@ void logic()
if ((mSpecialRechargeUpdateNeeded%11) == 0)
{
mSpecialRechargeUpdateNeeded = 0;
- for (SpecialsMap::iterator it = mSpecials.begin(),
+ for (auto it = mSpecials.begin(),
it_end = mSpecials.end(); it != it_end; it++)
{
it->second.currentMana += it->second.recharge;
@@ -341,7 +341,7 @@ public:
listen(Event::GameChannel);
}
- void event(Event::Channel channel, const Event &event)
+ void event(Event::Channel channel, const Event &event) override
{
if (channel == Event::ClientChannel)
{
@@ -351,7 +351,7 @@ public:
if (newState == STATE_GAME)
{
- if (mInventory == 0)
+ if (mInventory == nullptr)
{
mInventory = new Inventory(Inventory::INVENTORY);
mEquipment = new Equipment();
@@ -366,8 +366,8 @@ public:
delete mInventory;
delete mEquipment;
- mInventory = 0;
- mEquipment = 0;
+ mInventory = nullptr;
+ mEquipment = nullptr;
}
}
}