aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Howell2005-07-30 05:51:28 +0000
committerTravis Howell2005-07-30 05:51:28 +0000
commit03d7c4ba39b04ecc608e0eb0837d70d1913ea0c2 (patch)
treecbf1db66d2cc3136095848ef644135df825c7eeb
parente5cd51ecd15d4db8cebda3a4904bd33747101ffb (diff)
downloadscummvm-rg350-03d7c4ba39b04ecc608e0eb0837d70d1913ea0c2.tar.gz
scummvm-rg350-03d7c4ba39b04ecc608e0eb0837d70d1913ea0c2.tar.bz2
scummvm-rg350-03d7c4ba39b04ecc608e0eb0837d70d1913ea0c2.zip
Fix regression (Bug #1235863), limit code change to HE70+ games.
svn-id: r18599
-rw-r--r--scumm/actor.cpp29
1 files changed, 21 insertions, 8 deletions
diff --git a/scumm/actor.cpp b/scumm/actor.cpp
index 04eb39e1d4..7903527a7a 100644
--- a/scumm/actor.cpp
+++ b/scumm/actor.cpp
@@ -1292,20 +1292,33 @@ void ScummEngine::resetActorBgs() {
}
int ScummEngine::getActorFromPos(int x, int y) {
- int i, result;
- result = 0;
+ int i;
if (!testGfxAnyUsageBits(x / 8))
return 0;
- for (i = 1; i < _numActors; i++) {
- if (testGfxUsageBit(x / 8, i) && !getClass(i, kObjectClassUntouchable)
- && y >= _actors[i]._top && y <= _actors[i]._bottom && _actors[i]._pos.y > _actors[result]._pos.y) {
- if (_version > 2 || i != VAR(VAR_EGO)) {
- result = i;
+
+ if (_heversion >= 70) {
+ int result = 0;
+
+ for (i = 1; i < _numActors; i++) {
+ if (testGfxUsageBit(x / 8, i) && !getClass(i, kObjectClassUntouchable)
+ && y >= _actors[i]._top && y <= _actors[i]._bottom && _actors[i]._pos.y > _actors[result]._pos.y) {
+ if (_version > 2 || i != VAR(VAR_EGO)) {
+ result = i;
+ }
}
}
+ return result;
+ } else {
+ for (i = 1; i < _numActors; i++) {
+ if (testGfxUsageBit(x / 8, i) && !getClass(i, kObjectClassUntouchable)
+ && y >= _actors[i]._top && y <= _actors[i]._bottom) {
+ if (_version > 2 || i != VAR(VAR_EGO))
+ return i;
+ }
+ }
+ return 0;
}
- return result;
}
#ifndef DISABLE_SCUMM_7_8