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.cpp | |
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.cpp')
-rw-r--r-- | src/localplayer.cpp | 29 |
1 files changed, 3 insertions, 26 deletions
diff --git a/src/localplayer.cpp b/src/localplayer.cpp index ca639317..95fbd6f4 100644 --- a/src/localplayer.cpp +++ b/src/localplayer.cpp @@ -25,13 +25,11 @@ #include "configuration.h" #include "event.h" #include "flooritem.h" -#include "graphics.h" #include "guild.h" #include "item.h" #include "map.h" #include "particle.h" #include "playerinfo.h" -#include "simpleanimation.h" #include "sound.h" #include "gui/gui.h" @@ -42,43 +40,22 @@ #include "net/chathandler.h" #include "net/gamehandler.h" #include "net/guildhandler.h" -#include "net/inventoryhandler.h" #include "net/net.h" #include "net/partyhandler.h" #include "net/playerhandler.h" -#include "net/specialhandler.h" -#include "net/tradehandler.h" -#include "resources/animation.h" -#include "resources/imageset.h" #include "resources/iteminfo.h" #include "resources/userpalette.h" #include "utils/gettext.h" #include "utils/stringutils.h" -#include <cassert> - const int AWAY_LIMIT_TIMER = 60; LocalPlayer *local_player = nullptr; LocalPlayer::LocalPlayer(int id, int subtype): - Being(id, PLAYER, subtype, nullptr), - mAttackRange(-1), - mTargetTime(-1), - mLastTargetTime(-1), - mTarget(nullptr), - mPickUpTarget(nullptr), - mGoingToTarget(false), mKeepAttacking(false), - mLastActionTime(-1), - mWalkingDir(0), - mPathSetByMouse(false), - mMessageTime(0), - mShowIp(false), - mAwayDialog(nullptr), - mAfkTime(0), - mAwayMode(false) + Being(id, PLAYER, subtype, nullptr) { listen(Event::AttributesChannel); @@ -216,9 +193,9 @@ void LocalPlayer::setGMLevel(int level) Position LocalPlayer::getNextWalkPosition(unsigned char dir) { - // Compute where the next tile will be set. - int dx = 0, dy = 0; + int dx = 0; + int dy = 0; if (dir & Being::UP) dy--; if (dir & Being::DOWN) |