From 3ce39d2b497ab5356290a22b324181386af51c51 Mon Sep 17 00:00:00 2001 From: Thorbjørn Lindeijer Date: Tue, 5 Mar 2024 10:13:15 +0100 Subject: General code cleanups * Use final for all message handlers, Client, LocalPlayer, Being::getType, Being::setPosition and Being::setMap. (avoids some warnings about virtual dispatch in constructors) * Use auto in more places * Use emplace_back instead of push_back in some places * Use default member initializers * Less else after return * Removed superfluous .c_str() * Removed type aliases that are only used once * Removed more unused includes --- src/client.cpp | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'src/client.cpp') diff --git a/src/client.cpp b/src/client.cpp index 15ebcf96..df360d17 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -179,18 +179,7 @@ Client *Client::mInstance = nullptr; Client::Client(const Options &options): mOptions(options), - mGame(nullptr), - mCurrentDialog(nullptr), - mQuitDialog(nullptr), - mDesktop(nullptr), - mSetupButton(nullptr), - mState(STATE_CHOOSE_SERVER), - mOldState(STATE_START), - mStateAfterOkDialog(mState), - mIcon(nullptr), - mLogicCounterId(0), - mSecondsCounterId(0), - mLimitFps(false) + mStateAfterOkDialog(mState) { assert(!mInstance); mInstance = this; @@ -682,7 +671,7 @@ int Client::exec() { Worlds worlds = Net::getLoginHandler()->getWorlds(); - if (worlds.size() == 0) + if (worlds.empty()) { // Trust that the netcode knows what it's doing mState = STATE_UPDATE; -- cgit v1.2.3-70-g09d2