Fix: Creative mode flying and cheats enabled

This commit is contained in:
InviseDivine
2026-03-09 20:40:07 +02:00
parent 5311b134ac
commit 8a53d3432d
2 changed files with 94 additions and 102 deletions

View File

@@ -721,7 +721,7 @@ void Minecraft::tickInput() {
#endif
}
#endif
#if defined(PLATFORM_DESKTOP)
#if defined(PLATFORM_DESKTOP) || defined (_WIN32)
if (key == Keyboard::KEY_E) {
screenChooser.setScreen(SCREEN_BLOCKSELECTION);
}
@@ -741,22 +741,13 @@ void Minecraft::tickInput() {
// Change distance
if (key == Keyboard::KEY_F)
options.viewDistance = (options.viewDistance + 1) % 4;
#endif
#if defined(WIN32)
if (key == Keyboard::KEY_F) {
#ifdef CHEATS
if (key == Keyboard::KEY_J) {
options.isFlying = !options.isFlying;
player->noPhysics = options.isFlying;
}
// if (key == Keyboard::KEY_T) {
// options.thirdPersonView = !options.thirdPersonView;
// /*
// ImprovedNoise noise;
// for (int i = 0; i < 16; ++i)
// printf("%d\t%f\n", i, noise.grad2(i, 3, 8));
// */
// }
if (key == Keyboard::KEY_O) {
useAmbientOcclusion = !useAmbientOcclusion;
options.ambientOcclusion = useAmbientOcclusion;
@@ -849,6 +840,7 @@ void Minecraft::tickInput() {
}
}
#endif
#endif
#ifndef PLATFORM_DESKTOP
if (key == 82)

View File

@@ -52,7 +52,7 @@ void KeyboardInput::tick( Player* player )
ya *= 0.3f;
}
#ifdef RPI
#if defined(RPI) || defined(PLATFORM_DESKTOP)
wantUp = jumping;
wantDown = sneaking;
#endif