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

Many fixes by Krzysztof Nowaczyk #50

Merged
merged 8 commits into from
Aug 25, 2024
Merged

Many fixes by Krzysztof Nowaczyk #50

merged 8 commits into from
Aug 25, 2024

Conversation

sergiou87
Copy link
Owner

Krzysztof Nowaczyk contacted me and sent me some patches to fix certain issues he found ❤️

I haven't tested the patches yet, I only reviewed them and made total sense. I'm just gonna paste his explanation here:

I. Average time does not display fractional part

If you go to the statistics screen, the fractional part is always 0. Cause: integer division. Screenshots from SpeedFix 6.3 and OpenSupaplex 7.1.2 below:

SpeedFix 6.3
image

OpenSupaplex 7.1.2
image

II. User name in empty entries in Hall of Fame

When you start playing the game, the Hall of Fame is initially empty. When you complete the game, your name appears in the Hall of Fame, but not only in 1st place, but in 2nd and 3rd place too, with a time of 0:00:00. See screenshots below. Cause: the string containing the player name was not cleared when iterating over hall of fame entries.

SpeedFix 6.3
image

OpenSupaplex 7.1.2
image

III. Duplicate entries in Hall of Fame created

Let's take the following scenario: you start a game from a fresh state (Hall of Fame is clear). You complete the game. Your name appears as the first entry in the Hall of Fame. Then you want to go back to some of the already completed levels. After completing a level, another entry with your name, with the same time is created in the Hall of Fame (screenshot). This is because the completedAllLevels field of the PlayerEntry structure was updated incorrectly. The code in updateHallOfFameEntries function took the PlayerEntry and made a local copy of it, so the original PlayerEntry structure was never updated. I changed this, so now a pointer to a PlayerEntry is taken.

image

IV. Demo signatures are never appended

When recording a demo I found that if a signature is present in myspsig.txt it is never appended to the demo. That's because the file the game is trying to open is actually MYSPSIG.TXT, all uppercase, which caused a file open to fail. Another issue: when the signature is about to be written to the output file, the code tries to write to a wrong file handle. It tries to write to the signature file (which is open in read-only mode) instead of the demo file. One last bug: there was an "off by one" error when writing the signature to the output file and the last terminating 0xFF byte was not written to the file.

V. Restarting a level when recording a demo

When I was recording a demo, and wanted to restart the level, I tried using , "Restart level" instead of going back to the main menu. The demo buffer was not cleared, so all my inputs from the second attempt got glued together with the first attempt, making the demo nonsensical. I fixed this by stopping the demo recording when restarting a level.

Also, the F11 key support in the main menu (that was supposed to replay the loaded demo) appears to be unimplemented.

@sergiou87 sergiou87 force-pushed the fixes-everywhere branch from 383987e to 5cc5969 Compare May 1, 2023 15:18
Fix by Krzysztof Nowaczyk, thank you! ❤️
When you start playing the game, the Hall of Fame is initially empty. When you complete the game, your name appears in the Hall of Fame, but not only in 1st place, but in 2nd and 3rd place too, with a time of 0:00:00. See screenshots below. Cause: the string containing the player name was not cleared when iterating over hall of fame entries.

Fixed by Krzysztof Nowaczyk, thank you! :heart:
Let's take the following scenario: you start a game from a fresh state (Hall of Fame is clear). You complete the game. Your name appears as the first entry in the Hall of Fame. Then you want to go back to some of the already completed levels. After completing a level, another entry with your name, with the same time is created in the Hall of Fame (screenshot). This is because the completedAllLevels field of the PlayerEntry structure was updated incorrectly. The code in updateHallOfFameEntries function took the PlayerEntry and made a local copy of it, so the original PlayerEntry structure was never updated. I changed this, so now a pointer to a PlayerEntry is taken.

Fixed by Krzysztof Nowaczyk, thank you! ❤️
When I was recording a demo, and wanted to restart the level, I tried using <Esc>, "Restart level" instead of going back to the main menu. The demo buffer was not cleared, so all my inputs from the second attempt got glued together with the first attempt, making the demo nonsensical. I fixed this by stopping the demo recording when restarting a level.

Fixed by Krzysztof Nowaczyk, thank you! ❤️
When recording a demo I found that if a signature is present in myspsig.txt it is never appended to the demo. That's because the file the game is trying to open is actually MYSPSIG.TXT, all uppercase, which caused a file open to fail. Another issue: when the signature is about to be written to the output file, the code tries to write to a wrong file handle. It tries to write to the signature file (which is open in read-only mode) instead of the demo file. One last bug: there was an "off by one" error when writing the signature to the output file and the last terminating 0xFF byte was not written to the file.

Fixed by Krzysztof Nowaczyk, thank you! ❤️
@sergiou87 sergiou87 merged commit 16068b7 into master Aug 25, 2024
13 checks passed
@sergiou87 sergiou87 deleted the fixes-everywhere branch August 25, 2024 14:02
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