summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/localplayer.cpp12
-rw-r--r--src/localplayer.h3
2 files changed, 9 insertions, 6 deletions
diff --git a/src/localplayer.cpp b/src/localplayer.cpp
index c83082a44..5935dd140 100644
--- a/src/localplayer.cpp
+++ b/src/localplayer.cpp
@@ -156,7 +156,7 @@ LocalPlayer::LocalPlayer(int id, int subtype):
mLastTargetX = 0;
mLastTargetY = 0;
- mInvertDirection = config.getIntValue("invertMoveDirection");
+ mInvertDirection = 0;
mCrazyMoveType = config.getIntValue("crazyMoveType");
mCrazyMoveState = 0;
mAttackWeaponType = config.getIntValue("attackWeaponType");
@@ -1866,12 +1866,14 @@ void LocalPlayer::moveToHome()
static const unsigned invertDirectionSize = 5;
void LocalPlayer::changeMode(unsigned *var, unsigned limit, const char *conf,
- std::string (LocalPlayer::*func)(), unsigned def)
+ std::string (LocalPlayer::*func)(), unsigned def,
+ bool save)
{
(*var) ++;
if (*var >= limit)
*var = def;
- config.setValue(conf, *var);
+ if (save)
+ config.setValue(conf, *var);
if (miniStatusWindow)
miniStatusWindow->updateStatus();
const std::string str = (this->*func)();
@@ -1883,7 +1885,7 @@ void LocalPlayer::invertDirection()
{
mMoveState = 0;
changeMode(&mInvertDirection, invertDirectionSize, "invertMoveDirection",
- &LocalPlayer::getInvertDirectionString);
+ &LocalPlayer::getInvertDirectionString, 0, false);
}
static const char *invertDirectionStrings[] =
@@ -4122,7 +4124,7 @@ void LocalPlayer::checkNewName(Being *being)
void LocalPlayer::resetYellowBar()
{
- mInvertDirection = config.resetIntValue("invertMoveDirection");
+ mInvertDirection = 0;
mCrazyMoveType = config.resetIntValue("crazyMoveType");
mMoveToTargetType = config.resetIntValue("moveToTargetType");
mFollowMode = config.resetIntValue("followMode");
diff --git a/src/localplayer.h b/src/localplayer.h
index 5b755e4f6..77e25e291 100644
--- a/src/localplayer.h
+++ b/src/localplayer.h
@@ -523,7 +523,8 @@ class LocalPlayer : public Being, public ActorSpriteListener,
const char *getVarItem(const char **arr, unsigned index, unsigned sz);
void changeMode(unsigned *var, unsigned limit, const char *conf,
- std::string (LocalPlayer::*func)(), unsigned def = 0);
+ std::string (LocalPlayer::*func)(), unsigned def = 0,
+ bool save = true);
void crazyMove1();
void crazyMove2();