diff options
author | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-02-09 09:47:21 +0100 |
---|---|---|
committer | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-02-13 12:57:16 +0100 |
commit | c70be70cab3615cb36cc5f244671cf5d39f1fda8 (patch) | |
tree | b15e68552ffd6adda832a9ae5d38160ef8299d7f /src/localplayer.h | |
parent | 717eb07c0d51098e319059883b11ba6e2bf4cbb8 (diff) | |
download | mana-c70be70cab3615cb36cc5f244671cf5d39f1fda8.tar.gz mana-c70be70cab3615cb36cc5f244671cf5d39f1fda8.tar.bz2 mana-c70be70cab3615cb36cc5f244671cf5d39f1fda8.tar.xz mana-c70be70cab3615cb36cc5f244671cf5d39f1fda8.zip |
General code cleanups
* Removing unused includes
* Use member initialization
* Use range-based for loops
* Use nullptr
* Removed no longer used aliases
* Use override
* Don't use else after return
* Use '= delete' to remove implicit members
* Use std::string::empty instead of comparing to ""
Diffstat (limited to 'src/localplayer.h')
-rw-r--r-- | src/localplayer.h | 37 |
1 files changed, 17 insertions, 20 deletions
diff --git a/src/localplayer.h b/src/localplayer.h index 7a9020d6..82e38b5b 100644 --- a/src/localplayer.h +++ b/src/localplayer.h @@ -28,9 +28,6 @@ #include <guichan/actionlistener.hpp> -#include <memory> -#include <vector> - class ChatTab; class FloorItem; class ImageSet; @@ -187,7 +184,7 @@ class LocalPlayer : public Being void changeAwayMode(); - bool getAwayMode() + bool getAwayMode() const { return mAwayMode; } void setAway(const std::string &message); @@ -234,35 +231,35 @@ class LocalPlayer : public Being */ Position getNextWalkPosition(unsigned char dir); - int mAttackRange; + int mAttackRange = -1; - int mTargetTime; /**< How long the being has been targeted **/ + int mTargetTime = -1; /**< How long the being has been targeted **/ /** Time stamp of last targeting action, -1 if none. */ - int mLastTargetTime; + int mLastTargetTime = -1; - int mGMLevel; + int mGMLevel = 0; - Being *mTarget; + Being *mTarget = nullptr; - FloorItem *mPickUpTarget; + FloorItem *mPickUpTarget = nullptr; - bool mGoingToTarget; - bool mKeepAttacking; /**< Whether or not to continue to attack */ - int mLastActionTime; /**< Time stamp of the last action, -1 if none. */ - int mWalkingDir; /**< The direction the player is walking in. */ - bool mPathSetByMouse; /**< Tells if the path was set using mouse */ + bool mGoingToTarget = false; + bool mKeepAttacking = false; /**< Whether or not to continue to attack */ + int mLastActionTime = -1; /**< Time stamp of the last action, -1 if none. */ + int mWalkingDir = 0; /**< The direction the player is walking in. */ + bool mPathSetByMouse = false; /**< Tells if the path was set using mouse */ using MessagePair = std::pair<std::string, int>; /** Queued messages*/ std::list<MessagePair> mMessages; - int mMessageTime; + int mMessageTime = 0; - bool mShowIp; + bool mShowIp = false; AwayListener *mAwayListener; - OkDialog *mAwayDialog; - int mAfkTime; - bool mAwayMode; + OkDialog *mAwayDialog = nullptr; + int mAfkTime = 0; + bool mAwayMode = false; }; extern LocalPlayer *local_player; |