Ver código fonte

Check input destination position when moving using arrow keys

This one fix crash I reported in 2085
ArseniyShestakov 10 anos atrás
pai
commit
00de870f17
1 arquivos alterados com 2 adições e 1 exclusões
  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;