[Scummvm-git-logs] scummvm master -> 1d264cec6215fbd262710de8e831f71e4b76575b

dreammaster noreply at scummvm.org
Thu Dec 2 04:32:19 UTC 2021


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

Summary:
1d264cec62 SHERLOCK: Fix missing Rose Tattoo talk animations


Commit: 1d264cec6215fbd262710de8e831f71e4b76575b
    https://github.com/scummvm/scummvm/commit/1d264cec6215fbd262710de8e831f71e4b76575b
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2021-12-01T20:32:15-08:00

Commit Message:
SHERLOCK: Fix missing Rose Tattoo talk animations

We were comparing the wrong object name in the Rose Tattoo-specific
code, so the speaker was never found. It's not clear to me if this only
affected Watson, or if other NPCs were affected as well.

And while it may not make any difference, make sure that the "portrait"
string we compare against is also no more than four characters long,
since that's what the original engine did.

Changed paths:
    engines/sherlock/people.cpp
    engines/sherlock/tattoo/tattoo_people.cpp


diff --git a/engines/sherlock/people.cpp b/engines/sherlock/people.cpp
index 2b282c35b0..61f8a46285 100644
--- a/engines/sherlock/people.cpp
+++ b/engines/sherlock/people.cpp
@@ -261,10 +261,8 @@ int People::findSpeaker(int speaker) {
 		Object &obj = scene._bgShapes[idx];
 
 		if (obj._type == ACTIVE_BG_SHAPE) {
-			Common::String name(obj._name.c_str(), obj._name.c_str() + 4);
-
-			if (name.equalsIgnoreCase(portrait)
-				&& obj._name[4] >= '0' && obj._name[4] <= '9')
+			if (scumm_strnicmp(portrait, obj._name.c_str(), 4) == 0
+				&& Common::isDigit(obj._name[4]))
 				return idx;
 		}
 	}
diff --git a/engines/sherlock/tattoo/tattoo_people.cpp b/engines/sherlock/tattoo/tattoo_people.cpp
index 0eecfe05c4..f862b65fab 100644
--- a/engines/sherlock/tattoo/tattoo_people.cpp
+++ b/engines/sherlock/tattoo/tattoo_people.cpp
@@ -1380,9 +1380,8 @@ int TattooPeople::findSpeaker(int speaker) {
 			TattooPerson &p = (*this)[idx];
 
 			if (p._type == CHARACTER) {
-				Common::String name(p._name.c_str(), p._name.c_str() + 4);
-
-				if (name.equalsIgnoreCase(portrait) && p._npcName[4] >= '0' && p._npcName[4] <= '9')
+				if (scumm_strnicmp(portrait, p._npcName.c_str(), 4) == 0
+					&& Common::isDigit(p._npcName[4]))
 					return idx + CHARACTERS_INDEX;
 			}
 		}




More information about the Scummvm-git-logs mailing list