Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

lara_cheat: amend teleporting approach #223

Merged
merged 2 commits into from
Sep 9, 2024

Conversation

lahm86
Copy link
Collaborator

@lahm86 lahm86 commented Sep 9, 2024

Resolves #222.

This changes the animation reset to only occur if Lara is in an extra animation, therefore allowing any other regular in-game animations to complete normally after teleporting. This means that when in the Rig or HSH starting anim, for example, Lara will "reset" to standing still or being underwater. For other situations, whatever she is doing at the point of teleporting, she will complete the animation in her new position, and so it's more in-line with TR1X.

I think this is safer as there could be so many edge cases of checking what she is doing and working out how to reset it, and at which point to do so, such as when her arm is going from backpack to regular position.

The death we were seeing before when trying this approach in Rig isn't present - there must have been something going on with the extra anim whereby it requires the full reset.

@lahm86 lahm86 added this to the 0.3 milestone Sep 9, 2024
@lahm86 lahm86 self-assigned this Sep 9, 2024
@lahm86 lahm86 requested review from a team as code owners September 9, 2024 09:03
@lahm86 lahm86 requested review from rr-, walkawayy and aredfan and removed request for a team September 9, 2024 09:03
This changes the animation reset to only occur if Lara is in an extra
animation, therefore allowing any other regular in-game animations to
complete normally after teleporting.

Resolves LostArtefacts#222.
}
g_Lara.extra_anim = 0;
const bool has_flare = Lara_Cheat_HasFlare();
Lara_Cheat_ReinitialiseGunMeshes(has_flare);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I wonder if there's any way to simplify this logic?

Copy link
Collaborator Author

@lahm86 lahm86 Sep 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tidied it up, checking the flare state multiple times didn't make sense, as it's only needed just before Lara_InitialiseMeshes is called, as that's what resets it. Once we know more about flares we can hopefully eliminate it.

Copy link

@aredfan aredfan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. 👍

@lahm86 lahm86 merged commit 3e735f1 into LostArtefacts:develop Sep 9, 2024
2 checks passed
@lahm86 lahm86 deleted the issue-222-tp-reset branch September 9, 2024 11:51
@rr- rr- added the TR2 label Oct 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TR2X bug: Lara can end up with a rifle in one hand after teleporting
3 participants