From 8f758726a580d5fbe72c48a56dda69cfb2115be6 Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Fri, 23 Aug 2024 22:51:43 +0200 Subject: [PATCH] gun: fix early hiding of pistol meshes Resolves #1449. --- CHANGELOG.md | 1 + src/game/gun/gun_pistols.c | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c7e4ebb8..1bd71b982 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ ## [Unreleased](https://github.com/LostArtefacts/TR1X/compare/stable...develop) - ××××-××-×× +- fixed holstering pistols hiding the gun meshes 1 frame too early (#1449, regression from 0.6) - improved logs module names readability - improved crash debug information on Windows diff --git a/src/game/gun/gun_pistols.c b/src/game/gun/gun_pistols.c index a156937b7..f50f8c356 100644 --- a/src/game/gun/gun_pistols.c +++ b/src/game/gun/gun_pistols.c @@ -44,11 +44,11 @@ void Gun_Pistols_Undraw(const LARA_GUN_TYPE weapon_type) g_Lara.left_arm.rot.y = 0; g_Lara.left_arm.rot.z = 0; anil = LF_G_DRAW_END; + } else if (Anim_TestAbsFrameEqual(anil, LF_G_DRAW_START)) { + Gun_Pistols_UndrawMeshLeft(weapon_type); + anil--; } else if (Anim_TestAbsFrameRange(anil, LF_G_UNDRAW_BEND, LF_G_DRAW_END)) { anil--; - if (Anim_TestAbsFrameEqual(anil, LF_G_DRAW_START)) { - Gun_Pistols_UndrawMeshLeft(weapon_type); - } } g_Lara.left_arm.frame_number = anil; @@ -64,11 +64,11 @@ void Gun_Pistols_Undraw(const LARA_GUN_TYPE weapon_type) g_Lara.right_arm.rot.y = 0; g_Lara.right_arm.rot.z = 0; anir = LF_G_DRAW_END; + } else if (Anim_TestAbsFrameEqual(anir, LF_G_DRAW_START)) { + Gun_Pistols_UndrawMeshRight(weapon_type); + anir--; } else if (Anim_TestAbsFrameRange(anir, LF_G_UNDRAW_BEND, LF_G_DRAW_END)) { anir--; - if (Anim_TestAbsFrameEqual(anir, LF_G_DRAW_START)) { - Gun_Pistols_UndrawMeshRight(weapon_type); - } } g_Lara.right_arm.frame_number = anir;