aboutsummaryrefslogtreecommitdiff
path: root/engines/prince/prince.cpp
diff options
context:
space:
mode:
authorlukaslw2014-08-10 16:56:33 +0200
committerlukaslw2014-08-10 16:56:33 +0200
commit075ea1a0e01cb8f6f2bf672e9cc88399355d12c5 (patch)
tree991ad604dfd10340ee0172b26d7575afbd53adc3 /engines/prince/prince.cpp
parent70a94908d3ddab949cd0755c148d87e0c59d420b (diff)
downloadscummvm-rg350-075ea1a0e01cb8f6f2bf672e9cc88399355d12c5.tar.gz
scummvm-rg350-075ea1a0e01cb8f6f2bf672e9cc88399355d12c5.tar.bz2
scummvm-rg350-075ea1a0e01cb8f6f2bf672e9cc88399355d12c5.zip
PRINCE: makePath() - fix
Diffstat (limited to 'engines/prince/prince.cpp')
-rw-r--r--engines/prince/prince.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/engines/prince/prince.cpp b/engines/prince/prince.cpp
index 060c1ca233..bdf33e55a9 100644
--- a/engines/prince/prince.cpp
+++ b/engines/prince/prince.cpp
@@ -4422,12 +4422,18 @@ byte *PrinceEngine::makePath(int heroId, int currX, int currY, int destX, int de
if ((x1 != x2) || (y1 != y2)) {
findPoint(x1, y1);
- if (x1 != _fpX || y1 != _fpY) {
+ if (!getPixelAddr(_roomPathBitmap, _fpX, _fpY)) {
+ return nullptr;
+ }
+ if ((x1 != _fpX) || (y1 != _fpY)) {
x1 = _fpX;
y1 = _fpY;
}
findPoint(x2, y2);
- if (x2 != _fpX || y2 != _fpY) {
+ if (!getPixelAddr(_roomPathBitmap, _fpX, _fpY)) {
+ return nullptr;
+ }
+ if ((x2 != _fpX) || (y2 != _fpY)) {
x2 = _fpX;
y2 = _fpY;
if (!_flags->getFlagValue(Flags::EXACTMOVE)) {