Skip to content

Fix pausing after landing with Caps Lock or Shift on#14

Merged
veikkos merged 1 commit intosuomipelit:masterfrom
olafkryus:fix/pause-after-landing
Nov 8, 2020
Merged

Fix pausing after landing with Caps Lock or Shift on#14
veikkos merged 1 commit intosuomipelit:masterfrom
olafkryus:fix/pause-after-landing

Conversation

@olafkryus
Copy link
Copy Markdown
Collaborator

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.WaitForKeyPress replacement for the readkbd procedure 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).

Comment thread SJ3.PAS
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;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Does the fix affect these other checks here?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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.

@veikkos veikkos merged commit b05a7a9 into suomipelit:master Nov 8, 2020
@olafkryus olafkryus deleted the fix/pause-after-landing branch November 9, 2020 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants