diff options
| author | Max Horn | 2003-05-22 00:51:42 +0000 |
|---|---|---|
| committer | Max Horn | 2003-05-22 00:51:42 +0000 |
| commit | f43fb0dab8c9f91d9490ab742c1e65015d5bf00e (patch) | |
| tree | 3516f97191d1c2b438a845172346d0ea3c01e794 /scumm/actor.cpp | |
| parent | 340f3a650e9188217f827e7282eb6c9cc8664c8f (diff) | |
| download | scummvm-rg350-f43fb0dab8c9f91d9490ab742c1e65015d5bf00e.tar.gz scummvm-rg350-f43fb0dab8c9f91d9490ab742c1e65015d5bf00e.tar.bz2 scummvm-rg350-f43fb0dab8c9f91d9490ab742c1e65015d5bf00e.zip | |
freeze scripts & hide mouse during cutscenes; addde Actor::isPlayer method that should work in V2, too; fixed o2_walkActorToObject
svn-id: r7815
Diffstat (limited to 'scumm/actor.cpp')
| -rw-r--r-- | scumm/actor.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/scumm/actor.cpp b/scumm/actor.cpp index 2daa42f3c1..92bbabcf0d 100644 --- a/scumm/actor.cpp +++ b/scumm/actor.cpp @@ -631,7 +631,7 @@ AdjustBoxResult Actor::adjustXYToBeInBox(int dstX, int dstY) { flags = _vm->getBoxFlags(box); // Skip over invisible boxes - if (flags & kBoxInvisible && !(flags & kBoxPlayerOnly && !isInClass(kObjectClassPlayer))) + if (flags & kBoxInvisible && !(flags & kBoxPlayerOnly && !isPlayer())) continue; // For increased performance, we perform a quick test if @@ -1392,7 +1392,7 @@ void Actor::walkActorOld() { // FIXME: not sure if this is needed in non-Zak games, but I think it shouldn't // hurt there either. int flags = _vm->getBoxFlags(next_box); - if (flags & kBoxLocked && !(flags & kBoxPlayerOnly && !isInClass(kObjectClassPlayer))) { + if (flags & kBoxLocked && !(flags & kBoxPlayerOnly && !isPlayer())) { moving |= MF_LAST_LEG; return; } @@ -1526,3 +1526,12 @@ void Actor::classChanged(int cls, bool value) { bool Actor::isInClass(int cls) { return _vm->getClass(number, cls); } + +bool Actor::isPlayer() { + if (_vm->_features & GF_AFTER_V2) + return _vm->VAR(42) <= number && number <= _vm->VAR(43); + else + return isInClass(kObjectClassPlayer); +} + + |
