[Scummvm-git-logs] scummvm master -> d37bb89d438c6e182d68da460730b1cb7d17beac

sluicebox noreply at scummvm.org
Sat Jan 3 04:33:20 UTC 2026


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .

Summary:
d37bb89d43 SCI: Fix parser rejecting unknown numbers


Commit: d37bb89d438c6e182d68da460730b1cb7d17beac
    https://github.com/scummvm/scummvm/commit/d37bb89d438c6e182d68da460730b1cb7d17beac
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2026-01-02T20:33:05-08:00

Commit Message:
SCI: Fix parser rejecting unknown numbers

The parser is supposed to parse an unknown number as a special word,
but we have been using the wrong class code. This caused the parser
to reject such input in kParse, preventing scripts from matching on
unknown numbers with kSaid. It's unclear if FreeSCI had this bug,
or if we changed the code structure later but forgot to add bit
shifting to this line.

While investigating, I found that early SCI0 did not parse unknown
numbers, so I added a version check.

Fixes:
- PQ2 phone when dialing a wrong number
- LSL2 message when entering digits (later versions)
- LSL3 message when entering digits
- LSL3 locker room when entering digits

Thanks to @andrewmilici for reporting this

Fixes bug #16431

Changed paths:
    engines/sci/parser/vocabulary.cpp
    engines/sci/parser/vocabulary.h


diff --git a/engines/sci/parser/vocabulary.cpp b/engines/sci/parser/vocabulary.cpp
index f4d66f82203..8bd34644849 100644
--- a/engines/sci/parser/vocabulary.cpp
+++ b/engines/sci/parser/vocabulary.cpp
@@ -519,11 +519,12 @@ void Vocabulary::lookupWord(ResultWordList& retval, const char *word, int word_l
 		return;
 
 	// No match so far? Check if it's a number.
-
-	char *tester;
-	if ((strtol(tempword.c_str(), &tester, 10) >= 0) && (*tester == '\0')) { // Do we have a complete number here?
-		ResultWord tmp = { VOCAB_CLASS_NUMBER, VOCAB_MAGIC_NUMBER_GROUP };
-		retval.push_back(tmp);
+	if (getSciVersion() > SCI_VERSION_0_EARLY) {
+		char *tester;
+		if ((strtol(tempword.c_str(), &tester, 10) >= 0) && (*tester == '\0')) { // Do we have a complete number here?
+			ResultWord tmp = { VOCAB_CLASS_NOUN << 4, VOCAB_MAGIC_NUMBER_GROUP };
+			retval.push_back(tmp);
+		}
 	}
 }
 
diff --git a/engines/sci/parser/vocabulary.h b/engines/sci/parser/vocabulary.h
index 2a3fb52abf6..cb0d25f8d0f 100644
--- a/engines/sci/parser/vocabulary.h
+++ b/engines/sci/parser/vocabulary.h
@@ -67,8 +67,7 @@ enum {
 	VOCAB_CLASS_NOUN = 0x10,
 	VOCAB_CLASS_INDICATIVE_VERB = 0x20,
 	VOCAB_CLASS_ADVERB = 0x40,
-	VOCAB_CLASS_IMPERATIVE_VERB = 0x80,
-	VOCAB_CLASS_NUMBER = 0x001
+	VOCAB_CLASS_IMPERATIVE_VERB = 0x80
 };
 
 enum {




More information about the Scummvm-git-logs mailing list