From bfeeb73c4fda81f6a94e16a66f374fe14fe591c0 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 12 Apr 2012 23:31:45 +0300 Subject: Add missing checks to map.cpp --- src/map.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/map.cpp') diff --git a/src/map.cpp b/src/map.cpp index af40e68e5..ebad60f84 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -895,7 +895,7 @@ Path Map::findPath(int startX, int startY, int destX, int destY, // Path to be built up (empty by default) Path path; - if (startX >= mWidth || startY >= mHeight) + if (startX >= mWidth || startY >= mHeight || startX < 0 || startY < 0) return path; // Return when destination not walkable -- cgit v1.2.3-60-g2f50