summaryrefslogtreecommitdiff
path: root/src/being
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-07-21 23:33:48 +0300
committerAndrei Karas <akaras@inbox.ru>2014-07-21 23:33:48 +0300
commit90bfc776dc4975c523c4c35fb0778cd9b77dc164 (patch)
treed7fdd90433077b20d847ee39de8a05d33509fcd3 /src/being
parentc544a5ebb53d51fa98392188d2b44dc6ec27c390 (diff)
downloadplus-90bfc776dc4975c523c4c35fb0778cd9b77dc164.tar.gz
plus-90bfc776dc4975c523c4c35fb0778cd9b77dc164.tar.bz2
plus-90bfc776dc4975c523c4c35fb0778cd9b77dc164.tar.xz
plus-90bfc776dc4975c523c4c35fb0778cd9b77dc164.zip
move "change pvp attack type" option into gamemodifiers.
Diffstat (limited to 'src/being')
-rw-r--r--src/being/localplayer.cpp33
-rw-r--r--src/being/localplayer.h9
2 files changed, 2 insertions, 40 deletions
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;