diff options
author | Filippos Karapetis | 2017-08-20 17:09:56 +0300 |
---|---|---|
committer | Filippos Karapetis | 2017-08-20 17:10:33 +0300 |
commit | ca8785fdbf8dd458ac27ca1865b871c0618ebf79 (patch) | |
tree | 1550d6ef3dccb9e7dae1dc8ae4ddf5e296f41360 /engines/saga/script.cpp | |
parent | 06f934dc9f46a8fa4c88cdb56f6372320ad78aac (diff) | |
download | scummvm-rg350-ca8785fdbf8dd458ac27ca1865b871c0618ebf79.tar.gz scummvm-rg350-ca8785fdbf8dd458ac27ca1865b871c0618ebf79.tar.bz2 scummvm-rg350-ca8785fdbf8dd458ac27ca1865b871c0618ebf79.zip |
SAGA: Filter scene verbs on objects properly for IHNM. Fixes bug #9712
The original check was incorrectly disabled for IHNM in commit
ab6fb8e9c3. The check has been enabled again, with an added condition
for actors that can be used, like the jukebox in Gorrister's
Diffstat (limited to 'engines/saga/script.cpp')
-rw-r--r-- | engines/saga/script.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/engines/saga/script.cpp b/engines/saga/script.cpp index 3cc6586432..7a84944b17 100644 --- a/engines/saga/script.cpp +++ b/engines/saga/script.cpp @@ -1709,15 +1709,16 @@ void Script::whichObject(const Point& mousePoint) { if (_vm->getGameId() == GID_IHNM && objectId == 8199) newRightButtonVerb = getVerbType(kVerbLookAt); - if ((_currentVerb == getVerbType(kVerbPickUp)) || - (_currentVerb == getVerbType(kVerbOpen)) || - (_currentVerb == getVerbType(kVerbClose)) || - ((_currentVerb == getVerbType(kVerbGive)) && !_firstObjectSet) || - ((_currentVerb == getVerbType(kVerbUse)) && !(actor->_flags & kFollower))) { - if (_vm->getGameId() == GID_ITE) { - objectId = ID_NOTHING; - newObjectId = ID_NOTHING; - } + bool actorIsFollower = (actor->_flags & kFollower); + bool actorCanBeUsed = (actor->_flags & kUsable); + + if ( _currentVerb == getVerbType(kVerbPickUp) || + _currentVerb == getVerbType(kVerbOpen) || + _currentVerb == getVerbType(kVerbClose) || + (_currentVerb == getVerbType(kVerbGive) && !_firstObjectSet) || + (_currentVerb == getVerbType(kVerbUse) && !_firstObjectSet && !(actorIsFollower || actorCanBeUsed))) { + objectId = ID_NOTHING; + newObjectId = ID_NOTHING; } } } |