diff options
author | Bertrand Augereau | 2011-08-17 06:46:34 +0200 |
---|---|---|
committer | Bertrand Augereau | 2011-08-17 06:46:34 +0200 |
commit | 681af21e2f7133d98af48345a3747f7574f555c3 (patch) | |
tree | b368200eeefd7817ece3546bb4a81b6ce2dd809d /engines | |
parent | ca32fb2b34e36d5d02452d6f6c6c1c9f56f9a6b9 (diff) | |
download | scummvm-rg350-681af21e2f7133d98af48345a3747f7574f555c3.tar.gz scummvm-rg350-681af21e2f7133d98af48345a3747f7574f555c3.tar.bz2 scummvm-rg350-681af21e2f7133d98af48345a3747f7574f555c3.zip |
DREAMWEB: Arithmetic bugfix in door open/close range detection
Diffstat (limited to 'engines')
-rw-r--r-- | engines/dreamweb/sprite.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/engines/dreamweb/sprite.cpp b/engines/dreamweb/sprite.cpp index 2ecdac3fed..2fb52abe20 100644 --- a/engines/dreamweb/sprite.cpp +++ b/engines/dreamweb/sprite.cpp @@ -338,20 +338,18 @@ void DreamGenContext::dodoor() { void DreamGenContext::dodoor(Sprite *sprite, ObjData *objData) { uint8 ryanx = data.byte(kRyanx); uint8 ryany = data.byte(kRyany); - int8 deltax = ryanx - sprite->x; - int8 deltay = ryany - sprite->y; if (ryanx < sprite->x) { - if (deltax < (int8)data.byte(kDoorcheck1)) + if (ryanx < sprite->x + (int8)data.byte(kDoorcheck1)) goto shutdoor; } else { - if (deltax >= data.byte(kDoorcheck2)) + if (ryanx >= sprite->x + data.byte(kDoorcheck2)) goto shutdoor; } if (ryany < sprite->y) { - if (deltay < (int8)data.byte(kDoorcheck3)) + if (ryany < sprite->y + (int8)data.byte(kDoorcheck3)) goto shutdoor; } else { - if (deltay >= data.byte(kDoorcheck4)) + if (ryany >= sprite->y + data.byte(kDoorcheck4)) goto shutdoor; } //opendoor: |