瀏覽代碼

Erase outdated path that was previously available

Dydzio 2 年之前
父節點
當前提交
aabb26d210
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      client/PlayerLocalState.cpp

+ 3 - 0
client/PlayerLocalState.cpp

@@ -68,7 +68,10 @@ bool PlayerLocalState::setPath(const CGHeroInstance * h, const int3 & destinatio
 {
 	CGPath path;
 	if(!owner.cb->getPathsInfo(h)->getPath(path, destination))
+	{
+		paths.erase(h); //invalidate previously possible path if selected (before other hero blocked only path / fly spell expired)
 		return false;
+	}
 
 	setPath(h, path);
 	return true;