summaryrefslogtreecommitdiff
path: root/src/client.cpp
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-03-05 10:13:15 +0100
committerThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-03-06 21:49:14 +0000
commit3ce39d2b497ab5356290a22b324181386af51c51 (patch)
tree1b923b8be7e4d2ce8ff70768dc7fff596487935c /src/client.cpp
parenta9df89bda908e3b3d443db7f3ca865b6f12c75e5 (diff)
downloadmana-3ce39d2b497ab5356290a22b324181386af51c51.tar.gz
mana-3ce39d2b497ab5356290a22b324181386af51c51.tar.bz2
mana-3ce39d2b497ab5356290a22b324181386af51c51.tar.xz
mana-3ce39d2b497ab5356290a22b324181386af51c51.zip
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
Diffstat (limited to 'src/client.cpp')
-rw-r--r--src/client.cpp15
1 files changed, 2 insertions, 13 deletions
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;