diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-07-21 13:14:09 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-07-21 13:14:09 +0300 |
commit | 684e041568932a651aaeb09a1247f42860871a59 (patch) | |
tree | c1398692d694b01150b204a19199776b06a919a5 /src/being | |
parent | cfffcc941898c4163e1bd62b8e514d3535511666 (diff) | |
download | manaverse-684e041568932a651aaeb09a1247f42860871a59.tar.gz manaverse-684e041568932a651aaeb09a1247f42860871a59.tar.bz2 manaverse-684e041568932a651aaeb09a1247f42860871a59.tar.xz manaverse-684e041568932a651aaeb09a1247f42860871a59.zip |
move "change follow mode" option into gamemodifiers.
Diffstat (limited to 'src/being')
-rw-r--r-- | src/being/localplayer.cpp | 35 | ||||
-rw-r--r-- | src/being/localplayer.h | 8 |
2 files changed, 3 insertions, 40 deletions
diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp index 567834d48..63834f934 100644 --- a/src/being/localplayer.cpp +++ b/src/being/localplayer.cpp @@ -121,7 +121,6 @@ LocalPlayer::LocalPlayer(const int id, const uint16_t subtype) : mMagicAttackType(config.getIntValue("magicAttackType")), mPvpAttackType(config.getIntValue("pvpAttackType")), mAttackType(config.getIntValue("attackType")), - mFollowMode(config.getIntValue("followMode")), mImitationMode(config.getIntValue("imitationMode")), mLastTargetX(0), mLastTargetY(0), @@ -1263,34 +1262,6 @@ void LocalPlayer::changeMode(unsigned *restrict const var, debugMsg(str.substr(4)); } -static const unsigned followModeSize = 4; - -void LocalPlayer::changeFollowMode(const bool forward) -{ - changeMode(&mFollowMode, followModeSize, "followMode", - &LocalPlayer::getFollowModeString, 0, true, forward); -} - -static const char *const followModeStrings[] = -{ - // TRANSLATORS: folow mode in status bar - N_("(D) default follow"), - // TRANSLATORS: folow mode in status bar - N_("(R) relative follow"), - // TRANSLATORS: folow mode in status bar - N_("(M) mirror follow"), - // TRANSLATORS: folow mode in status bar - N_("(P) pet follow"), - // TRANSLATORS: folow mode in status bar - N_("(?) unknown follow") -}; - -std::string LocalPlayer::getFollowModeString() -{ - return gettext(getVarItem(&followModeStrings[0], - mFollowMode, followModeSize)); -} - const unsigned attackWeaponTypeSize = 4; void LocalPlayer::changeAttackWeaponType(const bool forward) @@ -3297,7 +3268,7 @@ void LocalPlayer::imitateDirection(const Being *const being, if (!PacketLimiter::limitPackets(PACKET_DIRECTION)) return; - if (mFollowMode == 2) + if (settings.followMode == 2) { uint8_t dir2 = 0; if (dir & BeingDirection::LEFT) @@ -3393,7 +3364,7 @@ void LocalPlayer::followMoveTo(const Being *const being, mPickUpTarget = nullptr; if (!mPlayerFollowed.empty() && being->getName() == mPlayerFollowed) { - switch (mFollowMode) + switch (settings.followMode) { case 0: setDestination(x1, y1); @@ -3613,7 +3584,7 @@ void LocalPlayer::resetYellowBar() settings.moveType = 0; settings.crazyMoveType = config.resetIntValue("crazyMoveType"); settings.moveToTargetType = config.resetIntValue("moveToTargetType"); - mFollowMode = config.resetIntValue("followMode"); + settings.followMode = config.resetIntValue("followMode"); mAttackWeaponType = config.resetIntValue("attackWeaponType"); mAttackType = config.resetIntValue("attackType"); mMagicAttackType = config.resetIntValue("magicAttackType"); diff --git a/src/being/localplayer.h b/src/being/localplayer.h index 20a16c5c7..76fe055da 100644 --- a/src/being/localplayer.h +++ b/src/being/localplayer.h @@ -192,9 +192,6 @@ class LocalPlayer final : public Being, int getAttackType() const A_WARN_UNUSED { return mAttackType; } - int getFollowMode() const A_WARN_UNUSED - { return mFollowMode; } - int getImitationMode() const A_WARN_UNUSED { return mImitationMode; } @@ -202,8 +199,6 @@ class LocalPlayer final : public Being, void changeAttackType(const bool forward); - void changeFollowMode(const bool forward); - void changeImitationMode(const bool forward); void changePickUpType(const bool forward); @@ -439,8 +434,6 @@ class LocalPlayer final : public Being, void setTestParticle(const std::string &fileName, const bool updateHash = true); - std::string getFollowModeString(); - std::string getAttackWeaponTypeString(); std::string getAttackTypeString(); @@ -534,7 +527,6 @@ class LocalPlayer final : public Being, // pvp attack type unsigned int mPvpAttackType; unsigned int mAttackType; - unsigned int mFollowMode; unsigned int mImitationMode; int mLastTargetX; |