diff options
Diffstat (limited to 'src/map.cpp')
-rw-r--r-- | src/map.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/map.cpp b/src/map.cpp index a658d8c6..c27a29d6 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -367,6 +367,13 @@ std::list<PATH_NODE> Map::findPath( // 14 for moving diagonal int Gcost = curr.tile->Gcost + ((dx == 0 || dy == 0) ? 10 : 14); + // Skip if Gcost becomes too much + // Warning: probably not entirely accurate + if (Gcost > 200) + { + continue; + } + if (newTile->whichList != onOpenList) { // Found a new tile (not on open nor on closed list) |