summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjak1 <mike.wollmann@gmail.com>2020-11-04 09:34:16 +0100
committerjak1 <mike.wollmann@gmail.com>2021-03-11 22:17:31 +0000
commit90b77f4c3939f1da10c7a21a182e913ff0e2ec1d (patch)
tree37c8a46d366a441eb121de8646b8054e8b6cf851 /src
parent7124d95d082d77b7e00447a4ecad094e575e8fa9 (diff)
downloadplus-90b77f4c3939f1da10c7a21a182e913ff0e2ec1d.tar.gz
plus-90b77f4c3939f1da10c7a21a182e913ff0e2ec1d.tar.bz2
plus-90b77f4c3939f1da10c7a21a182e913ff0e2ec1d.tar.xz
plus-90b77f4c3939f1da10c7a21a182e913ff0e2ec1d.zip
added desync walkaround
Diffstat (limited to 'src')
-rw-r--r--src/being/being.cpp6
-rw-r--r--src/being/being.h1
-rw-r--r--src/defaults.cpp1
-rw-r--r--src/gui/widgets/checkbox.cpp1
-rw-r--r--src/gui/widgets/label.cpp2
-rw-r--r--src/gui/widgets/tabs/setup_misc.cpp12
6 files changed, 22 insertions, 1 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp
index 072d1f30a..b12b00c08 100644
--- a/src/being/being.cpp
+++ b/src/being/being.cpp
@@ -140,6 +140,7 @@ bool Being::mEnableReorderSprites = true;
bool Being::mHideErased = false;
Move Being::mMoveNames = Move_false;
bool Being::mUseDiagonal = true;
+int Being::mPlayerSpeedAdjustment = 0;
BadgeDrawType::Type Being::mShowBadges = BadgeDrawType::Top;
int Being::mAwayEffect = -1;
VisibleNamePos::Type Being::mVisibleNamePos = VisibleNamePos::Bottom;
@@ -1812,6 +1813,9 @@ void Being::nextTile() restrict2
mSpeed = mWalkSpeed;
}
+ if (this == localPlayer)
+ mSpeed = mSpeed + mPlayerSpeedAdjustment;
+
if (mX != pos.x || mY != pos.y)
{
mOldHeight = mMap->getHeightOffset(mX, mY);
@@ -3448,6 +3452,8 @@ void Being::reReadConfig()
mHideErased = config.getBoolValue("hideErased");
mMoveNames = fromBool(config.getBoolValue("moveNames"), Move);
mUseDiagonal = config.getBoolValue("useDiagonalSpeed");
+ mPlayerSpeedAdjustment =
+ serverConfig.getIntValue("playerSpeedAdjustment");
mShowBadges = static_cast<BadgeDrawType::Type>(
config.getIntValue("showBadges"));
mVisibleNamePos = static_cast<VisibleNamePos::Type>(
diff --git a/src/being/being.h b/src/being/being.h
index 0dd0a5743..1431aeab3 100644
--- a/src/being/being.h
+++ b/src/being/being.h
@@ -1348,6 +1348,7 @@ class Being notfinal : public ActorSprite,
static bool mHideErased;
static Move mMoveNames;
static bool mUseDiagonal;
+ static int mPlayerSpeedAdjustment;
static BadgeDrawType::Type mShowBadges;
static int mAwayEffect;
static VisibleNamePos::Type mVisibleNamePos;
diff --git a/src/defaults.cpp b/src/defaults.cpp
index 91c9e11b3..9cbd478be 100644
--- a/src/defaults.cpp
+++ b/src/defaults.cpp
@@ -119,6 +119,7 @@ void setConfigDefaults(Configuration &cfg)
AddDEF("syncPlayerMove", true);
AddDEF("syncPlayerMoveDistance", 5);
AddDEF("syncPlayerMoveDistanceLegacy", 15);
+ AddDEF("playerSpeedAdjustment", 0);
AddDEF("drawPath", false);
AddDEF("moveToTargetType", 10);
AddDEF("crazyMoveProgram", "mumrsonmdmlon");
diff --git a/src/gui/widgets/checkbox.cpp b/src/gui/widgets/checkbox.cpp
index b01a4e679..c57af2eaa 100644
--- a/src/gui/widgets/checkbox.cpp
+++ b/src/gui/widgets/checkbox.cpp
@@ -161,6 +161,7 @@ CheckBox::~CheckBox()
if (theme != nullptr)
theme->unload(mSkin);
}
+ removeMouseListener(this);
}
void CheckBox::draw(Graphics *const graphics)
diff --git a/src/gui/widgets/label.cpp b/src/gui/widgets/label.cpp
index 9dfa7ce4d..d325e11bd 100644
--- a/src/gui/widgets/label.cpp
+++ b/src/gui/widgets/label.cpp
@@ -144,7 +144,7 @@ void Label::init()
mPadding = mSkin->getPadding();
else
mPadding = 0;
- setSelectable(false);
+ setSelectable(true);
}
void Label::draw(Graphics *const graphics)
diff --git a/src/gui/widgets/tabs/setup_misc.cpp b/src/gui/widgets/tabs/setup_misc.cpp
index 40276a59e..1a04cbd64 100644
--- a/src/gui/widgets/tabs/setup_misc.cpp
+++ b/src/gui/widgets/tabs/setup_misc.cpp
@@ -273,6 +273,18 @@ Setup_Misc::Setup_Misc(const Widget2 *const widget) :
MainConfig_true);
// TRANSLATORS: settings option
+ new SetupItemIntTextField(_("Increase your effective Walk Delay"),
+ // TRANSLATORS: settings description
+ _("Walk slower than your maximum allowed speed.\n"
+ "This can decrease desync when autonav is used over "
+ "long distances, and makes it easier for others to "
+ "autofollow you.\n"
+ "0 is off, 15~20 is recommended for evol2 servers."),
+ "playerSpeedAdjustment",
+ this, "playerSpeedAdjustmentEvent", 0, 100,
+ MainConfig_false);
+
+ // TRANSLATORS: settings option
new SetupItemTextField(_("Crazy move A program"), "",
"crazyMoveProgram", this, "crazyMoveProgramEvent",
MainConfig_true, UseBase64_false);