aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Howell2006-01-17 03:07:00 +0000
committerTravis Howell2006-01-17 03:07:00 +0000
commit090fcd45792e66cd567bcf35d1c75ba13653c2a3 (patch)
treeb50802aec3d8c9da2dfb26970fde3b778c3a7f39
parent61a7d3a8ad44fc3b6517bcaba1d14f19372e587d (diff)
downloadscummvm-rg350-090fcd45792e66cd567bcf35d1c75ba13653c2a3.tar.gz
scummvm-rg350-090fcd45792e66cd567bcf35d1c75ba13653c2a3.tar.bz2
scummvm-rg350-090fcd45792e66cd567bcf35d1c75ba13653c2a3.zip
Fix actor selection in spyfox.
svn-id: r20066
-rw-r--r--scumm/actor.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/scumm/actor.cpp b/scumm/actor.cpp
index 34e5c7290d..e892c78248 100644
--- a/scumm/actor.cpp
+++ b/scumm/actor.cpp
@@ -1316,22 +1316,20 @@ int ScummEngine::getActorFromPos(int x, int y) {
#ifndef DISABLE_HE
int ScummEngine_v70he::getActorFromPos(int x, int y) {
- int i;
- int result = 0;
+ int curActor, i;
if (!testGfxAnyUsageBits(x / 8))
return 0;
+ curActor = 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;
- }
- }
+ && y >= _actors[i]._top && y <= _actors[i]._bottom
+ && (_actors[i]._pos.y > _actors[curActor]._pos.y || curActor == 0))
+ curActor = i;
}
- return result;
+ return curActor;
}
#endif