Fix pausing after landing with Caps Lock or Shift on#14
Merged
veikkos merged 1 commit intosuomipelit:masterfrom Nov 8, 2020
Merged
Fix pausing after landing with Caps Lock or Shift on#14veikkos merged 1 commit intosuomipelit:masterfrom
veikkos merged 1 commit intosuomipelit:masterfrom
Conversation
veikkos
reviewed
Nov 8, 2020
| ch:=upcase(ch); | ||
| end; | ||
| if (ch=#0) and (Ch2=#68) then begin cupslut:=true; ch:=#27; end; | ||
| if (Ch=#27) or (Ch=#13) then Out:=True; |
Member
There was a problem hiding this comment.
Does the fix affect these other checks here?
Collaborator
Author
There was a problem hiding this comment.
I've made a quick test and upcase seems to return unmodified character code if it's outside the 'a'..'z' range, so it shouldn't break anything here. And this conversion is done in two other places in this very file in the exact same manner, so either way we're at least consistent. I see there are also other places in code where upcase is called for the specific check only, but since those two previously mentioned seem to work fine I don't think there will be any problem.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A very minor but easy to fix bug.
P key can be used as a pause button during the jump. The check is done in the main program code in two places, one for the phase before landing on line 1731, and for after landing on line 2459. The first one checks for an uppercase P input and is preceded by
ch:=upcase(ch);on line 1705, during the second check however the input is never uppercased and instead the game checks for a lowercase P. This makes pausing using P key with Caps Lock on after landing impossible. This pull request fixes the issue.The bug however does not affect the SDL version, but this is only due to Shift and Caps Lock key being ignored altogether in the
SDLPort.WaitForKeyPressreplacement for thereadkbdprocedure from the DOS version. Therefore the bug will appear by itself when that is fixed. 🤪Moreover, the same bug also exists in DOS version of the game, so it should be backported if a new release is planned sometime (I think this bug is way too minor to justify a new release for just this fix alone).