aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/dreamweb/object.cpp21
1 files changed, 8 insertions, 13 deletions
diff --git a/engines/dreamweb/object.cpp b/engines/dreamweb/object.cpp
index 9d5ea15fa3..10138acb78 100644
--- a/engines/dreamweb/object.cpp
+++ b/engines/dreamweb/object.cpp
@@ -343,25 +343,20 @@ void DreamGenContext::identifyOb() {
return;
}
- ax = data.word(kMousex) - data.word(kMapadx);
- bx = data.word(kMousey) - data.word(kMapady);
+ uint16 initialX = data.word(kMousex) - data.word(kMapadx);
+ uint16 initialY = data.word(kMousey) - data.word(kMapady);
- if (ax >= 22 * 8 || bx >= 20 * 8) {
+ if (initialX >= 22 * 8 || initialY >= 20 * 8) {
blank();
return;
}
+ byte x = initialX & 0xFF;
+ byte y = initialY & 0xFF;
+
data.byte(kInmaparea) = 1;
- ah = bl;
- push(ax);
- data.byte(kPointerspath) = findPathOfPoint(al, ah);
- ax = pop();
- push(ax);
- data.byte(kPointerfirstpath) = findFirstPath(al, ah);
- ax = pop();
-
- byte x = al;
- byte y = ah;
+ data.byte(kPointerspath) = findPathOfPoint(x, y);
+ data.byte(kPointerfirstpath) = findFirstPath(x, y);
if (checkIfEx(x, y) || checkIfFree(x, y) ||
checkIfPerson(x, y) || checkIfSet(x, y))