Closed iegik closed 2 years ago
I'm seeing a similar issue.
I have several units. I press 'w' on the active unit, and it does NOT wait, it stays active.
I have to click on another available unit to activate that one.
Another situation: pressed 'f' to fortify the active unit. Said unit stayed flashing with the 'F' marker. Again, had to click on another unit to switch.
So far, this is a two-part problem.
Part 1. BaseUnit.Busy was modified incorrectly:
- return (Sentry || Fortify);
+return MovesLeft <= 0 || PartMoves <= 0 && (Sentry || Fortify || _order != Order.None);
needs to be:
+return MovesLeft <= 0 && PartMoves <= 0 || (Sentry || Fortify || _order != Order.None);
That is, a unit was marked busy if it had partial moves left (and thus issue #178). Also, a unit was NOT marked busy if it was Fortifying.
Part 2. Game.ActiveUnit was modified to prevent an infinite loop of looking for the next active unit. The infinite loop would have occurred because BaseUnit.Busy was incorrect [actually busy units would have been flagged as not-busy].
The removed code had the function of advancing through the units to find the NEXT not-busy unit. By removing the code, the returned unit was always the FIRST not-busy unit. The FIRST not-busy unit is usually the unit the player just ordered to wait. Thus the problems where "waiting" a unit did not switch to another unit.
I have a Sail and Diplomat (created in previous turn) in the city