aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Howell2005-04-01 14:46:58 +0000
committerTravis Howell2005-04-01 14:46:58 +0000
commitc832b858b783266ca54b53127069ad7504a7b6db (patch)
tree38cb7074d8c58d8d1ba9cb70af2bfe642ea79b4d
parent9f01b54bcfd7871f4a4a4fb58a9df65e96aae5d0 (diff)
downloadscummvm-rg350-c832b858b783266ca54b53127069ad7504a7b6db.tar.gz
scummvm-rg350-c832b858b783266ca54b53127069ad7504a7b6db.tar.bz2
scummvm-rg350-c832b858b783266ca54b53127069ad7504a7b6db.zip
Actor order needs to be checked too (For HE games)
svn-id: r17327
-rw-r--r--scumm/actor.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/scumm/actor.cpp b/scumm/actor.cpp
index dec39e9e57..fcb1294fac 100644
--- a/scumm/actor.cpp
+++ b/scumm/actor.cpp
@@ -1215,18 +1215,20 @@ void ScummEngine::resetActorBgs() {
}
int ScummEngine::getActorFromPos(int x, int y) {
- int i;
+ int i, result;
+ result = 0;
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) {
- if (_version > 2 || i != VAR(VAR_EGO))
- return i;
+ && 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 0;
+ return result;
}
void ScummEngine::actorTalk(const byte *msg) {