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 ++------------------------------- 1 file changed, 2 insertions(+), 31 deletions(-) (limited to 'src/being/localplayer.cpp') 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; -- cgit v1.2.3-60-g2f50