From 075ea1a0e01cb8f6f2bf672e9cc88399355d12c5 Mon Sep 17 00:00:00 2001 From: lukaslw Date: Sun, 10 Aug 2014 16:56:33 +0200 Subject: PRINCE: makePath() - fix --- engines/prince/prince.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'engines/prince/prince.cpp') 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)) { -- cgit v1.2.3