From 90bfc776dc4975c523c4c35fb0778cd9b77dc164 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 21 Jul 2014 23:33:48 +0300 Subject: move "change pvp attack type" option into gamemodifiers. --- src/being/localplayer.cpp | 33 ++------------------------------- src/being/localplayer.h | 9 --------- 2 files changed, 2 insertions(+), 40 deletions(-) (limited to 'src/being') diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp index 84768e443..baeb75146 100644 --- a/src/being/localplayer.cpp +++ b/src/being/localplayer.cpp @@ -115,7 +115,6 @@ LocalPlayer::LocalPlayer(const int id, const uint16_t subtype) : mGMLevel(0), mCrazyMoveState(0), mMoveState(0), - mPvpAttackType(config.getIntValue("pvpAttackType")), mImitationMode(config.getIntValue("imitationMode")), mLastTargetX(0), mLastTargetY(0), @@ -1286,34 +1285,6 @@ std::string LocalPlayer::getMapDrawTypeString() viewport->getMapDrawType(), debugPathSize)); } -const unsigned pvpAttackSize = 4; - -void LocalPlayer::switchPvpAttack(const bool forward) -{ - changeMode(&mPvpAttackType, pvpAttackSize, "pvpAttackType", - &LocalPlayer::getPvpAttackString, 0, true, forward); -} - -static const char *const pvpAttackStrings[] = -{ - // TRANSLATORS: player attack type in status bar - N_("(a) attack all players"), - // TRANSLATORS: player attack type in status bar - N_("(f) attack all except friends"), - // TRANSLATORS: player attack type in status bar - N_("(b) attack bad relations"), - // TRANSLATORS: player attack type in status bar - N_("(d) don't attack players"), - // TRANSLATORS: player attack type in status bar - N_("(?) pvp attack") -}; - -std::string LocalPlayer::getPvpAttackString() -{ - return gettext(getVarItem(&pvpAttackStrings[0], - mPvpAttackType, pvpAttackSize)); -} - const unsigned imitationModeSize = 2; void LocalPlayer::changeImitationMode(const bool forward) @@ -3433,7 +3404,7 @@ void LocalPlayer::resetYellowBar() settings.attackWeaponType = config.resetIntValue("attackWeaponType"); settings.attackType = config.resetIntValue("attackType"); settings.magicAttackType = config.resetIntValue("magicAttackType"); - mPvpAttackType = config.resetIntValue("pvpAttackType"); + settings.pvpAttackType = config.resetIntValue("pvpAttackType"); settings.quickDropCounter = config.resetIntValue("quickDropCounter"); settings.pickUpType = config.resetIntValue("pickUpType"); if (viewport) @@ -3478,7 +3449,7 @@ bool LocalPlayer::checAttackPermissions(const Being *const target) const if (!target) return false; - switch (mPvpAttackType) + switch (settings.pvpAttackType) { case 0: return true; diff --git a/src/being/localplayer.h b/src/being/localplayer.h index 354339016..191ed73fe 100644 --- a/src/being/localplayer.h +++ b/src/being/localplayer.h @@ -203,11 +203,6 @@ class LocalPlayer final : public Being, void setCrazyMoveState(const unsigned int n) { mCrazyMoveState = n; } - void switchPvpAttack(const bool forward); - - int getPvpAttackType() const A_WARN_UNUSED - { return mPvpAttackType; } - int getDisableGameModifiers() const A_WARN_UNUSED { return mDisableGameModifiers; } @@ -409,8 +404,6 @@ class LocalPlayer final : public Being, static std::string getMapDrawTypeString(); - std::string getPvpAttackString(); - std::string getImitationModeString(); std::string getAwayModeString(); @@ -479,8 +472,6 @@ class LocalPlayer final : public Being, unsigned int mCrazyMoveState; // move state. used if mMoveType == 2 unsigned int mMoveState; - // pvp attack type - unsigned int mPvpAttackType; unsigned int mImitationMode; int mLastTargetX; -- cgit v1.2.3-70-g09d2