From 10a1095ab2e535ddb56c9fd5a411cb21a475199b Mon Sep 17 00:00:00 2001 From: Sally Knight Date: Thu, 12 Mar 2026 02:07:36 +0300 Subject: [PATCH] fix: add proper head movement to player inventory preview --- Minecraft.Client/UI/Screens/InventoryScreen.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Minecraft.Client/UI/Screens/InventoryScreen.cpp b/Minecraft.Client/UI/Screens/InventoryScreen.cpp index 841eeb4e5..355e2b0a8 100644 --- a/Minecraft.Client/UI/Screens/InventoryScreen.cpp +++ b/Minecraft.Client/UI/Screens/InventoryScreen.cpp @@ -58,6 +58,8 @@ void InventoryScreen::renderBg(float a) float oybr = minecraft->player->yBodyRot; float oyr = minecraft->player->yRot; float oxr = minecraft->player->xRot; + float oyh = minecraft->player->yHeadRot; + float oyhp = minecraft->player->yHeadRotO; float xd = (xo + 51) - xMouse; float yd = (yo + 75 - 50) - yMouse; @@ -71,12 +73,16 @@ void InventoryScreen::renderBg(float a) minecraft->player->yBodyRot = (float) atan(xd / 40.0f) * 20; minecraft->player->yRot = (float) atan(xd / 40.0f) * 40; minecraft->player->xRot = -(float) atan(yd / 40.0f) * 20; + minecraft->player->yHeadRot = (float) atan(xd / 40.0f) * 40; + minecraft->player->yHeadRotO = (float) atan(xd / 40.0f) * 40; glTranslatef(0, minecraft->player->heightOffset, 0); EntityRenderDispatcher::instance->playerRotY = 180; EntityRenderDispatcher::instance->render(minecraft->player, 0, 0, 0, 0, 1); minecraft->player->yBodyRot = oybr; minecraft->player->yRot = oyr; minecraft->player->xRot = oxr; + minecraft->player->yHeadRot = oyh; + minecraft->player->yHeadRotO = oyhp; glPopMatrix(); Lighting::turnOff(); glDisable(GL_RESCALE_NORMAL);