fix: replace jump-based if statement with declaration & use turnX/turnY

This commit is contained in:
2026-08-26 19:27:10 -05:00
parent 405b054ff5
commit c41a78f1ef
+4 -5
View File
@@ -7,9 +7,6 @@
#include "Input.h"
#include "..\Minecraft.Client\LocalPlayer.h"
#include "Options.h"
#ifdef _WINDOWS64
#include "Windows64/KBMInput.h"
#endif
Input::Input()
{
@@ -150,6 +147,8 @@ void Input::tick(LocalPlayer *player)
tx = ty = 0.0f;
}
float turnX = tx * abs(tx) * turnSpeed;
float turnY = ty * abs(ty) * turnSpeed;
#ifdef _WINDOWS64
if (iPad == 0 && g_KBMInput.IsMouseGrabbed() && g_KBMInput.IsKBMActive())
{
@@ -168,7 +167,7 @@ void Input::tick(LocalPlayer *player)
}
#endif
player->interpolateTurn(tx * abs(tx) * turnSpeed, ty * abs(ty) * turnSpeed);
player->interpolateTurn(turnX, turnY);
//jumping = controller.isButtonPressed(0);
@@ -178,7 +177,7 @@ void Input::tick(LocalPlayer *player)
#ifdef _WINDOWS64
kbJump = (iPad == 0) && g_KBMInput.IsMouseGrabbed() && g_KBMInput.IsKBMActive() && g_KBMInput.IsKeyDown(KeyboardMouseInput::KEY_JUMP);
#endif
if( (jump > 0 || kbJump) && pMinecraft->localgameModes[iPad]->isInputAllowed(MINECRAFT_ACTION_JUMP) )
jumping = (jump > 0 || kbJump) && pMinecraft->localgameModes[iPad]->isInputAllowed(MINECRAFT_ACTION_JUMP)
#ifndef _CONTENT_PACKAGE
if (app.GetFreezePlayers()) jumping = false;