diff options
author | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-01-26 16:07:54 +0100 |
---|---|---|
committer | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-01-26 16:07:54 +0100 |
commit | 5afe88df2538274859a162ffd63ed52118e80c19 (patch) | |
tree | b610dfd58dc748fd63f49565b2a43eea2316714f /src/net/manaserv/charhandler.cpp | |
parent | 73ba2a95f5bd4a0dd09af52d5864800be2b0a4c6 (diff) | |
download | mana-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/net/manaserv/charhandler.cpp')
-rw-r--r-- | src/net/manaserv/charhandler.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/net/manaserv/charhandler.cpp b/src/net/manaserv/charhandler.cpp index ece8e108..d5a5497e 100644 --- a/src/net/manaserv/charhandler.cpp +++ b/src/net/manaserv/charhandler.cpp @@ -187,7 +187,7 @@ void CharHandler::handleCharacterCreateResponse(MessageIn &msg) if (mCharCreateDialog) { mCharCreateDialog->scheduleDelete(); - mCharCreateDialog = 0; + mCharCreateDialog = nullptr; } } } @@ -228,7 +228,7 @@ void CharHandler::handleCharacterDeleteResponse(MessageIn &msg) } new OkDialog(_("Error"), errorMessage); } - mSelectedCharacter = 0; + mSelectedCharacter = nullptr; unlockCharSelectDialog(); } @@ -254,7 +254,7 @@ void CharHandler::handleCharacterSelectResponse(MessageIn &msg) // Prevent the selected local player from being deleted local_player = mSelectedCharacter->dummy; PlayerInfo::setBackend(mSelectedCharacter->data); - mSelectedCharacter->dummy = 0; + mSelectedCharacter->dummy = nullptr; Client::setState(STATE_CONNECT_GAME); } @@ -386,7 +386,7 @@ void CharHandler::updateCharacters() { const CachedCharacterInfo &info = mCachedCharacterInfos.at(i); - Net::Character *character = new Net::Character; + auto *character = new Net::Character; character->slot = info.slot; LocalPlayer *player = character->dummy = new LocalPlayer; player->setName(info.name); @@ -397,7 +397,7 @@ void CharHandler::updateCharacters() character->data.mAttributes[CHAR_POINTS] = info.characterPoints; character->data.mAttributes[CORR_POINTS] = info.correctionPoints; - for (CachedAttributes::const_iterator it = info.attribute.begin(), + for (auto it = info.attribute.begin(), it_end = info.attribute.end(); it != it_end; it++) { character->data.mStats[i].base = it->second.base; @@ -412,8 +412,8 @@ void CharHandler::updateCharacters() void CharHandler::clear() { - setCharCreateDialog(0); - setCharSelectDialog(0); + setCharCreateDialog(nullptr); + setCharSelectDialog(nullptr); mCachedCharacterInfos.clear(); updateCharacters(); |