From c6731387783fc7ce5c3665df4bbd431584f1611e 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 b649922ae..3c7fa0734 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-70-g09d2