mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-11 18:50:46 +00:00
PCExhumed: Cheat code fixes.
Default to level 0 if no level number is specified and don't crash if only space characters are submitted. Thanks to NY00123 for reporting.
This commit is contained in:
parent
746aa4da82
commit
bddcde73f4
1 changed files with 7 additions and 2 deletions
|
@ -1076,7 +1076,7 @@ void CheckKeys()
|
|||
{
|
||||
char *pToken = strtok(sHollyStr, " ");
|
||||
|
||||
if (nStringLen == 0) // bjd - added this check. watcom allows passing NULL to strcmp so the below checks will all fail OK on DOS but will cause a crash on Windows
|
||||
if (nStringLen == 0 || pToken == NULL) // bjd - added this check. watcom allows passing NULL to strcmp so the below checks will all fail OK on DOS but will cause a crash on Windows
|
||||
{
|
||||
bHolly = kFalse;
|
||||
StatusMessage(1, " ");
|
||||
|
@ -1097,7 +1097,12 @@ void CheckKeys()
|
|||
else if (!strcmp(pToken, "LEVEL"))
|
||||
{
|
||||
pToken = strtok(NULL, " ");
|
||||
levelnew = atoi(pToken);
|
||||
if (pToken) {
|
||||
levelnew = atoi(pToken);
|
||||
}
|
||||
else {
|
||||
levelnew = 0; // replicate original DOS EXE behaviour when no level number is specified.
|
||||
}
|
||||
}
|
||||
else if (!strcmp(pToken, "DOORS"))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue