diff options
author | Loïc Blot <nerzhul@users.noreply.github.com> | 2017-06-17 19:11:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-17 19:11:28 +0200 |
commit | 8f7785771b9e02b1a1daf7a252550d78ea93053d (patch) | |
tree | 7a4e4b524dbc63fed3dac99a3844b634cc621d0d /src/client.cpp | |
parent | 76be103a91d6987527af19e87d93007be8ba8a67 (diff) | |
download | minetest-8f7785771b9e02b1a1daf7a252550d78ea93053d.tar.gz minetest-8f7785771b9e02b1a1daf7a252550d78ea93053d.tar.bz2 minetest-8f7785771b9e02b1a1daf7a252550d78ea93053d.zip |
Cpp11 initializers 2 (#5999)
* C++11 patchset 10: continue cleanup on constructors
* Drop obsolete bool MainMenuData::enable_public (setting is called with cURL in server loop)
* More classes cleanup
* More classes cleanup + change NULL tests to boolean tests
Diffstat (limited to 'src/client.cpp')
-rw-r--r-- | src/client.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/client.cpp b/src/client.cpp index 7a097bc0d..aa6a5d30d 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -221,7 +221,7 @@ Client::~Client() scene::IAnimatedMesh *mesh = m_device->getSceneManager()->getMeshCache()->getMeshByIndex(0); - if (mesh != NULL) + if (mesh) m_device->getSceneManager()->getMeshCache()->removeMesh(mesh); } @@ -383,7 +383,7 @@ void Client::step(float dtime) */ // Control local player (0ms) LocalPlayer *player = m_env.getLocalPlayer(); - assert(player != NULL); + assert(player); player->applyControl(dtime); // Step environment @@ -459,7 +459,7 @@ void Client::step(float dtime) if (block) { // Delete the old mesh delete block->mesh; - block->mesh = NULL; + block->mesh = nullptr; if (r.mesh) { minimap_mapblock = r.mesh->moveMinimapMapblock(); @@ -1370,7 +1370,7 @@ void Client::addNode(v3s16 p, MapNode n, bool remove_metadata) void Client::setPlayerControl(PlayerControl &control) { LocalPlayer *player = m_env.getLocalPlayer(); - assert(player != NULL); + assert(player); player->control = control; } @@ -1394,7 +1394,7 @@ bool Client::getLocalInventoryUpdated() void Client::getLocalInventory(Inventory &dst) { LocalPlayer *player = m_env.getLocalPlayer(); - assert(player != NULL); + assert(player); dst = player->inventory; } @@ -1407,7 +1407,7 @@ Inventory* Client::getInventory(const InventoryLocation &loc) case InventoryLocation::CURRENT_PLAYER: { LocalPlayer *player = m_env.getLocalPlayer(); - assert(player != NULL); + assert(player); return &player->inventory; } break; @@ -1496,7 +1496,7 @@ void Client::setCrack(int level, v3s16 pos) u16 Client::getHP() { LocalPlayer *player = m_env.getLocalPlayer(); - assert(player != NULL); + assert(player); return player->hp; } @@ -1529,7 +1529,7 @@ void Client::typeChatMessage(const std::wstring &message) // compatibility code if (m_proto_ver < 29) { LocalPlayer *player = m_env.getLocalPlayer(); - assert(player != NULL); + assert(player); std::wstring name = narrow_to_wide(player->getName()); pushToChatQueue((std::wstring)L"<" + name + L"> " + message); } |