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

inventory: reset selected item on closing inventory #1882

Merged
merged 2 commits into from
Nov 12, 2024

Conversation

lahm86
Copy link
Collaborator

@lahm86 lahm86 commented Nov 12, 2024

Resolves #1586.

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

Description

Most of this is config noise, the fix is simply setting g_InvKeysCurrent = 0; after closing the inventory, otherwise the game will try to select a non-existent item if you go back in via Esc > Up (or whatever your bindings are).

I've left the option defaulting to false, in line with the other TR1 glitch fixing options, but LMK what you think about this.

The issue has the steps for testing TR2. In TR1, you can try this:

  • /play 9
  • /tp 77
  • /give rusty
  • /give gold
  • Use the rusty key by pressing action at one of the keyholes
  • Go to the other keyhole and manually go into the inventory to select the gold key. Depending on the setting it will either be glitched out and act as the rusty key, or it will behave properly and you won't be able to use it here.

This resets the selected key item when the inventory is closed to avoid
it being pre-selected to a non-existent item when the inventory is
re-opened.

Resolves LostArtefacts#1586.
This resets the selected key item when the inventory is closed to avoid
it being pre-selected to a non-existent item when the inventory is
re-opened.

Resolves LostArtefacts#1586.
@lahm86 lahm86 added OG bug A bug in original game TR2 TR1 labels Nov 12, 2024
@lahm86 lahm86 self-assigned this Nov 12, 2024
@lahm86 lahm86 requested review from a team as code owners November 12, 2024 15:42
@lahm86 lahm86 requested review from rr-, walkawayy and aredfan and removed request for a team November 12, 2024 15:42
Copy link

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.

Tested both scenarios with the option on and off, LGTM.

Thank you for working on this bugfix.

@lahm86 lahm86 merged commit e1f77f9 into LostArtefacts:develop Nov 12, 2024
6 checks passed
@lahm86 lahm86 deleted the issue-1586-fix-item-dupe branch November 12, 2024 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OG bug A bug in original game TR1 TR2
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

OG bug: One of the plaques stops spinning and its name disappear
3 participants