Skip to content

Commit a5572d5

Browse files
committed
fix: prevent TAS from anti-speedlocking on ground
1 parent 0f2c4e6 commit a5572d5

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/Features/Tas/TasParser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ static std::vector<Line> tokenize(std::ifstream &file) {
193193
return lines;
194194
}
195195

196-
#define MAX_SCRIPT_VERSION 4
196+
#define MAX_SCRIPT_VERSION 5
197197
#define _STR1(x) #x
198198
#define _STR(x) _STR1(x)
199199

src/Features/Tas/TasTools/StrafeTool.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,8 @@ int AutoStrafeTool::GetTurningDirection(const TasPlayerInfo &pInfo, float desAng
377377
bool speedLockAvoided = false;
378378

379379
// prevent losing acceleration speed from speedlock on newer versions
380-
if (asParams->antiSpeedLock && tasPlayer->scriptVersion >= 4) {
380+
// also remember that speedlock exists only when midair in versions 5 or newer
381+
if (asParams->antiSpeedLock && tasPlayer->scriptVersion >= 4 && (!pInfo.grounded || tasPlayer->scriptVersion < 5)) {
381382
if (pInfo.velocity.Length2D() < asParams->strafeSpeed.speed && pInfo.velocity.Length2D() >= 300.0f) {
382383

383384
Vector wishDir(0, 1);

0 commit comments

Comments
 (0)