Skip to content

Commit d0643c9

Browse files
committed
[VirtualInput] Stop updating the camera angle if window is inactive
Fixes a tiny annoyance during development. If you have "pauseOnLostFocus" disabled and hat if you Tab out of the game and move your cursor, the camera would still follow your mouse. If you wanted to copy something from ingame, your cursor would move constantly, making it very annoying
1 parent 4b98ba6 commit d0643c9

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/main/java/com/minecrafttas/tasmod/mixin/playbackhooks/MixinEntityRenderer.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.minecrafttas.tasmod.mixin.playbackhooks;
22

3+
import org.lwjgl.opengl.Display;
34
import org.spongepowered.asm.mixin.Final;
45
import org.spongepowered.asm.mixin.Mixin;
56
import org.spongepowered.asm.mixin.Shadow;
@@ -65,8 +66,8 @@ public void playback_injectAtStartSection(float partialTicks, long nanoTime, Cal
6566
float mouseSensititvity = this.mc.gameSettings.mouseSensitivity * 0.6F + 0.2F;
6667
float mouseSensitivityCubed = mouseSensititvity * mouseSensititvity * mouseSensititvity * 8.0F;
6768

68-
if (this.mc.currentScreen == null && !TASmodClient.controller.isPlayingback() && mc.player != null) {
69-
mc.mouseHelper.mouseXYChange();
69+
mc.mouseHelper.mouseXYChange();
70+
if (this.mc.currentScreen == null && !TASmodClient.controller.isPlayingback() && mc.player != null && Display.isActive()) {
7071
float deltaPitch = mc.mouseHelper.deltaY * mouseSensitivityCubed;
7172
float deltaYaw = mc.mouseHelper.deltaX * mouseSensitivityCubed;
7273

0 commit comments

Comments
 (0)