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

tr1/lara/cheat: reset meshes in fly cheat #2571

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

lahm86
Copy link
Collaborator

@lahm86 lahm86 commented Mar 1, 2025

Resolves #2565.
Resolves #2572.

Checklist

  • I have read the coding conventions
  • I have added a changelog entry about what my pull request accomplishes, or it is an internal change
  • I have added a readme entry about my new feature or OG bug fix, or it is a different change

Description

This restores Lara's meshes if she is resurrected with the fly cheat. The only scenario we can't efficiently cover is the following:

  • draw magnums or uzis
  • draw shotgun
  • die and resurrect

In this case the holstered guns will be pistols because we don't store the last holstered gun type, and looking it up would involve a lot of mesh comparison which I don't feel is worth it, plus for things like the T-Rex and Midas deaths, the information is lost anyway. If the last gun is not the shotgun, the correct holster meshes will be restored normally.

Otherwise, other scenarios should hopefully work as expected 🤞 Worth checking #2461 too.

@lahm86 lahm86 added TRX bug A bug with TRX TR1 labels Mar 1, 2025
@lahm86 lahm86 self-assigned this Mar 1, 2025
@lahm86 lahm86 requested review from a team as code owners March 1, 2025 12:53
@lahm86 lahm86 requested review from rr-, walkawayy and aredfan and removed request for a team March 1, 2025 12:53
Copy link

github-actions bot commented Mar 1, 2025

@aredfan
Copy link
Collaborator

aredfan commented Mar 1, 2025

Everything looks good, thank you. 👍

I did find a bug with Lara holding a shotgun in one hand, but I don't think it's related to this PR as it's already on develop, will raise an issue shortly.

@lahm86 lahm86 force-pushed the issue-2565-cheat-meshes branch from d6b2cf3 to 8d20aab Compare March 1, 2025 15:01
@lahm86 lahm86 changed the title tr1/lara/cheat: reset meshes on resurrection tr1/lara/cheat: reset meshes in fly cheat Mar 1, 2025
@lahm86
Copy link
Collaborator Author

lahm86 commented Mar 1, 2025

Everything looks good, thank you. 👍

I did find a bug with Lara holding a shotgun in one hand, but I don't think it's related to this PR as it's already on develop, will raise an issue shortly.

Thanks, should be addressed. Easiest just to do it here as it's all so related.

@lahm86 lahm86 requested a review from aredfan March 1, 2025 15:03
Copy link
Collaborator

@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.

Thanks, should be addressed. Easiest just to do it here as it's all so related.

Your fix did the trick. Thank you. 😄

Gun_SetLaraHolsterLMesh(holsters_gun_type);
Gun_SetLaraHolsterRMesh(holsters_gun_type);
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

This logic is duplicated from somewhere isn't it? I think Lara_InitialiseMeshes. Any chance we can avoid duplication?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, Lara_InitialiseMeshes uses RESUME_INFO though, so doesn't take into account guns she currently has, plus it results in the original bug with #2461. Maybe we could change the signature though.

Copy link
Collaborator

@rr- rr- left a comment

Choose a reason for hiding this comment

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

LGTM but it'd be nice to merge the common parts, possibly through a new, third function.

@lahm86
Copy link
Collaborator Author

lahm86 commented Mar 1, 2025

LGTM but it'd be nice to merge the common parts, possibly through a new, third function.

WDYT about getting rid of resume->flags.costume in favour of just testing if it's currently the gym level? I think this would make it easier to merge the functions as we don't really need RESUME_INFO; Lara's inventory is already initialised on the only other call to Savegame_ApplyLogicToCurrentInfo.

@rr-
Copy link
Collaborator

rr- commented Mar 1, 2025

LGTM but it'd be nice to merge the common parts, possibly through a new, third function.

WDYT about getting rid of resume->flags.costume in favour of just testing if it's currently the gym level? I think this would make it easier to merge the functions as we don't really need RESUME_INFO; Lara's inventory is already initialised on the only other call to Savegame_ApplyLogicToCurrentInfo.

This will make adding a potential option to change costumes at runtime more difficult; can we use a hybrid solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TR1 TRX bug A bug with TRX
Projects
Status: In review
3 participants