forked from cafeberry/cafeberry
fix: replace jump-based if statement with declaration & use turnX/turnY
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user