diff options
author | Martin Kiewitz | 2015-06-07 00:30:40 +0200 |
---|---|---|
committer | Martin Kiewitz | 2015-06-07 00:30:40 +0200 |
commit | dfd036bf71ddf8fe3abe8c103e7af25f83fbf094 (patch) | |
tree | bb85648234fa6bb50b55b8aad18de6242341804e /engines/sherlock/people.cpp | |
parent | 10741d5bd68f556f5314a80c8d959767e76b4f8a (diff) | |
parent | c95783172b1a9bdb4e2e7d3230418f9d89244416 (diff) | |
download | scummvm-rg350-dfd036bf71ddf8fe3abe8c103e7af25f83fbf094.tar.gz scummvm-rg350-dfd036bf71ddf8fe3abe8c103e7af25f83fbf094.tar.bz2 scummvm-rg350-dfd036bf71ddf8fe3abe8c103e7af25f83fbf094.zip |
Merge branch 'master' of github.com:scummvm/scummvm
Diffstat (limited to 'engines/sherlock/people.cpp')
-rw-r--r-- | engines/sherlock/people.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/engines/sherlock/people.cpp b/engines/sherlock/people.cpp index f4060f65da..e59a90e5f8 100644 --- a/engines/sherlock/people.cpp +++ b/engines/sherlock/people.cpp @@ -583,6 +583,7 @@ void People::goAllTheWay() { int People::findSpeaker(int speaker) { Scene &scene = *_vm->_scene; + const char *portrait = _characters[speaker]._portrait; for (int idx = 0; idx < (int)scene._bgShapes.size(); ++idx) { Object &obj = scene._bgShapes[idx]; @@ -590,12 +591,29 @@ int People::findSpeaker(int speaker) { if (obj._type == ACTIVE_BG_SHAPE) { Common::String name(obj._name.c_str(), obj._name.c_str() + 4); - if (name.equalsIgnoreCase(_characters[speaker]._portrait) + if (name.equalsIgnoreCase(portrait) && obj._name[4] >= '0' && obj._name[4] <= '9') return idx; } } + // Fallback in Rose Tattoo + if (IS_ROSE_TATTOO) { + bool flag = _vm->readFlags(76); + + if (_data[0]._type == CHARACTER && ((speaker == 0 && flag) || (speaker == 1 && !flag))) + return -1; + + for (uint idx = 1; idx < MAX_CHARACTERS; ++idx) { + if (_data[idx]._type == CHARACTER) { + Common::String name(_data[idx]._name.c_str(), _data[idx]._name.c_str() + 4); + + if (name.equalsIgnoreCase(portrait) && _data[idx]._npcName[4] >= '0' && _data[idx]._npcName[4] <= '9') + return idx + 256; + } + } + } + return -1; } |