diff options
Diffstat (limited to 'engines/prince/prince.cpp')
-rw-r--r-- | engines/prince/prince.cpp | 10 |
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)) { |