diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-12-21 21:46:41 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-12-21 21:46:41 +0300 |
commit | e9a9f2592c9d8919550c46a15f0b43a6bc230422 (patch) | |
tree | edb8223bd9b54c4891f081093c9be05d7e6ba96d | |
parent | c56987b081c790819c0f2190613feb855ec68745 (diff) | |
download | manaverse-e9a9f2592c9d8919550c46a15f0b43a6bc230422.tar.gz manaverse-e9a9f2592c9d8919550c46a15f0b43a6bc230422.tar.bz2 manaverse-e9a9f2592c9d8919550c46a15f0b43a6bc230422.tar.xz manaverse-e9a9f2592c9d8919550c46a15f0b43a6bc230422.zip |
Dont load move type from config.
-rw-r--r-- | src/localplayer.cpp | 12 | ||||
-rw-r--r-- | src/localplayer.h | 3 |
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(); |