Skip to content

Fix array indexing when no record is selected #1

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

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

Conversation

mvolfik
Copy link

@mvolfik mvolfik commented May 17, 2024

When the game was started with m_albumRevealed = -1, the code soon used this negative value to index the albums array, causing out of bounds access. This PR creates a constant for the no album selected state, and checks that this is not the value of the m_albumRevealed variable before indexing into the array.

This was also the reason why the message about scrolling wasn't being displayed (at least on my machine), now it also works.


I'm a big fan of games by Amanita Design, and this small piece really reminded them of their game style. Love it!

This also allows the message about scrolling to be actually displayed at start.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants