summaryrefslogtreecommitdiff
path: root/src/being/localplayer.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-07-21 13:24:00 +0300
committerAndrei Karas <akaras@inbox.ru>2014-07-21 13:24:00 +0300
commit623c0127e4ad5170e9ee003475ed566cec55cfeb (patch)
tree269181626445874223a4b450ea65d6dbc46fb3c3 /src/being/localplayer.cpp
parent684e041568932a651aaeb09a1247f42860871a59 (diff)
downloadplus-623c0127e4ad5170e9ee003475ed566cec55cfeb.tar.gz
plus-623c0127e4ad5170e9ee003475ed566cec55cfeb.tar.bz2
plus-623c0127e4ad5170e9ee003475ed566cec55cfeb.tar.xz
plus-623c0127e4ad5170e9ee003475ed566cec55cfeb.zip
move "change attack weapon type" option into gamemodifiers.
Diffstat (limited to 'src/being/localplayer.cpp')
-rw-r--r--src/being/localplayer.cpp35
1 files changed, 3 insertions, 32 deletions
diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp
index 63834f934..aed4a17e2 100644
--- a/src/being/localplayer.cpp
+++ b/src/being/localplayer.cpp
@@ -114,7 +114,6 @@ LocalPlayer::LocalPlayer(const int id, const uint16_t subtype) :
StatListener(),
mGMLevel(0),
mCrazyMoveState(0),
- mAttackWeaponType(config.getIntValue("attackWeaponType")),
mQuickDropCounter(config.getIntValue("quickDropCounter")),
mMoveState(0),
mPickUpType(config.getIntValue("pickUpType")),
@@ -1262,34 +1261,6 @@ void LocalPlayer::changeMode(unsigned *restrict const var,
debugMsg(str.substr(4));
}
-const unsigned attackWeaponTypeSize = 4;
-
-void LocalPlayer::changeAttackWeaponType(const bool forward)
-{
- changeMode(&mAttackWeaponType, attackWeaponTypeSize, "attackWeaponType",
- &LocalPlayer::getAttackWeaponTypeString, 1, true, forward);
-}
-
-static const char *const attackWeaponTypeStrings[] =
-{
- // TRANSLATORS: switch attack type in status bar
- N_("(?) attack"),
- // TRANSLATORS: switch attack type in status bar
- N_("(D) default attack"),
- // TRANSLATORS: switch attack type in status bar
- N_("(s) switch attack without shield"),
- // TRANSLATORS: switch attack type in status bar
- N_("(S) switch attack with shield"),
- // TRANSLATORS: switch attack type in status bar
- N_("(?) attack")
-};
-
-std::string LocalPlayer::getAttackWeaponTypeString()
-{
- return gettext(getVarItem(&attackWeaponTypeStrings[0],
- mAttackWeaponType, attackWeaponTypeSize));
-}
-
const unsigned attackTypeSize = 4;
void LocalPlayer::changeAttackType(const bool forward)
@@ -1598,7 +1569,7 @@ std::string LocalPlayer::getGameModifiersString()
void LocalPlayer::changeEquipmentBeforeAttack(const Being *const target) const
{
- if (mAttackWeaponType == 1 || !target || !PlayerInfo::getInventory())
+ if (settings.attackWeaponType == 1 || !target || !PlayerInfo::getInventory())
return;
bool allowSword = false;
@@ -1637,7 +1608,7 @@ void LocalPlayer::changeEquipmentBeforeAttack(const Being *const target) const
PlayerInfo::equipItem(item, true);
// if need equip shield too
- if (mAttackWeaponType == 3)
+ if (settings.attackWeaponType == 3)
{
// searching shield
const WeaponsInfos &shields = WeaponsDB::getShields();
@@ -3585,7 +3556,7 @@ void LocalPlayer::resetYellowBar()
settings.crazyMoveType = config.resetIntValue("crazyMoveType");
settings.moveToTargetType = config.resetIntValue("moveToTargetType");
settings.followMode = config.resetIntValue("followMode");
- mAttackWeaponType = config.resetIntValue("attackWeaponType");
+ settings.attackWeaponType = config.resetIntValue("attackWeaponType");
mAttackType = config.resetIntValue("attackType");
mMagicAttackType = config.resetIntValue("magicAttackType");
mPvpAttackType = config.resetIntValue("pvpAttackType");