From f35b135e1738899be7745a2667de3d908f725f29 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Sun, 20 Jan 2019 09:07:27 +0000 Subject: Change 81330b8d6e: Cached path only needs to be cleared if it was found to be invalid. --- src/ship_cmd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/ship_cmd.cpp b/src/ship_cmd.cpp index 7727aa608..e3886aa34 100644 --- a/src/ship_cmd.cpp +++ b/src/ship_cmd.cpp @@ -484,9 +484,9 @@ static Track ChooseShipTrack(Ship *v, TileIndex tile, DiagDirection enterdir, Tr } /* Cached path is invalid so continue with pathfinder. */ + v->path.clear(); } - v->path.clear(); switch (_settings_game.pf.pathfinder_for_ships) { case VPF_OPF: track = OPFShipChooseTrack(v, tile, enterdir, tracks, path_found); break; case VPF_NPF: track = NPFShipChooseTrack(v, tile, enterdir, tracks, path_found); break; -- cgit v1.2.3-70-g09d2