瀏覽代碼

Check input destination position when moving using arrow keys

This one fix crash I reported in 2085
ArseniyShestakov 10 年之前
父節點
當前提交
00de870f17
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      client/windows/CAdvmapInterface.cpp

+ 2 - 1
client/windows/CAdvmapInterface.cpp

@@ -1192,7 +1192,8 @@ void CAdvMapInt::keyPressed(const SDL_KeyboardEvent & key)
 
 			CGPath &path = LOCPLINT->paths[h];
 			terrain.currentPath = &path;
-			if(!LOCPLINT->cb->getPathsInfo(h)->getPath(h->getPosition(false) + dir, path))
+			int3 dst = h->getPosition(false) + dir;
+			if(dst != verifyPos(dst) || !LOCPLINT->cb->getPathsInfo(h)->getPath(dst, path))
 			{
 				terrain.currentPath = nullptr;
 				return;