mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-20 17:03:05 +00:00
Make sure walk coordinate are valid before checking path buffer.
svn-id: r48846
This commit is contained in:
parent
9001a8fbc3
commit
4cb1fc9e79
@ -73,10 +73,10 @@ void PathWalker_NS::correctPathPoint(Common::Point &to) {
|
||||
int16 left = to.x;
|
||||
do {
|
||||
right++;
|
||||
} while (!IS_PATH_CLEAR(right, to.y) && (right < maxX));
|
||||
} while ((right < maxX) && !IS_PATH_CLEAR(right, to.y));
|
||||
do {
|
||||
left--;
|
||||
} while (!IS_PATH_CLEAR(left, to.y) && (left > 0));
|
||||
} while ((left > 0) && !IS_PATH_CLEAR(left, to.y));
|
||||
right = (right == maxX) ? 1000 : right - to.x;
|
||||
left = (left == 0) ? 1000 : to.x - left;
|
||||
|
||||
@ -85,10 +85,10 @@ void PathWalker_NS::correctPathPoint(Common::Point &to) {
|
||||
int16 bottom = to.y;
|
||||
do {
|
||||
top--;
|
||||
} while (!IS_PATH_CLEAR(to.x, top) && (top > 0));
|
||||
} while ((top > 0) && !IS_PATH_CLEAR(to.x, top));
|
||||
do {
|
||||
bottom++;
|
||||
} while (!IS_PATH_CLEAR(to.x, bottom) && (bottom < maxY));
|
||||
} while ((bottom < maxY) && !IS_PATH_CLEAR(to.x, bottom) );
|
||||
top = (top == 0) ? 1000 : to.y - top;
|
||||
bottom = (bottom == maxY) ? 1000 : bottom - to.y;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user