Fix stuck travel for good

My fixes to the travel stuck oscillation did not fix all of them,
and I've even seen a 3-step loop - which my fixes cannot detect.
I guess there could be arbitrary-sized loops too.

To definitely fix this, keep track of all the map locations travel
has moved the hero through, and if it tries to go on a location already
used, stop travel and give the unsure -message.
This commit is contained in:
Pasi Kallinen
2022-04-02 18:16:19 +03:00
parent fd355d6f6c
commit 6977aef436
5 changed files with 26 additions and 12 deletions

View File

@@ -3855,6 +3855,10 @@ reset_cmd_vars(boolean reset_cmdq)
g.multi = 0;
iflags.menu_requested = FALSE;
g.context.travel = g.context.travel1 = 0;
if (g.travelmap) {
selection_free(g.travelmap, TRUE);
g.travelmap = NULL;
}
if (reset_cmdq)
cmdq_clear();
}