Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TR2X bug: Lara doesn't submerge when forward + jump is used #1863

Closed
aredfan opened this issue Nov 11, 2024 · 1 comment · Fixed by #1869
Closed

TR2X bug: Lara doesn't submerge when forward + jump is used #1863

aredfan opened this issue Nov 11, 2024 · 1 comment · Fixed by #1869
Assignees
Labels
TR2 TRX bug A bug with TRX

Comments

@aredfan
Copy link
Collaborator

aredfan commented Nov 11, 2024

Regression since: 0.6


Have Lara float on water, then have her moving forward before using jump as well.

@lahm86
Copy link
Collaborator

lahm86 commented Nov 11, 2024

This fixes it (and TR1 does a similar check) but I'm failing to see where the regression comes from - I can't see this having been removed in earlier commits. Will continue investigating.

diff --git a/src/tr2/game/lara/state.c b/src/tr2/game/lara/state.c
index 7efcca99..6e09dcdf 100644
--- a/src/tr2/game/lara/state.c
+++ b/src/tr2/game/lara/state.c
@@ -909,7 +909,7 @@ void __cdecl Lara_State_SurfSwim(ITEM *item, COLL_INFO *coll)
     } else if (g_Input.right) {
         item->rot.y += LARA_SLOW_TURN;
     }
-    if (!g_Input.forward || g_Input.back) {
+    if (!g_Input.forward || g_Input.back || g_Input.jump) {
         item->goal_anim_state = LS_SURF_TREAD;
     }
     item->fall_speed += 8;

@lahm86 lahm86 self-assigned this Nov 11, 2024
@lahm86 lahm86 moved this from Ready to In progress in TRX Dev tracker Nov 11, 2024
lahm86 added a commit to lahm86/TRX that referenced this issue Nov 11, 2024
Before the input refactor, the check was (g_Input & LS_BACK) - LS_BACK
is a state, which happens to have the same value as IN_JUMP. So in the
refactor, it was converted to g_Input.back.

Resolves LostArtefacts#1863.
@lahm86 lahm86 moved this from In progress to In review in TRX Dev tracker Nov 11, 2024
lahm86 added a commit that referenced this issue Nov 11, 2024
Before the input refactor, the check was (g_Input & LS_BACK) - LS_BACK
is a state, which happens to have the same value as IN_JUMP. So in the
refactor, it was converted to g_Input.back.

Resolves #1863.
@github-project-automation github-project-automation bot moved this from In review to Done in TRX Dev tracker Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TR2 TRX bug A bug with TRX
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants