Summary: ORDER_FULL_MP waits if unit's move rate is reduced
after orders laid in
                 Project: Freeciv
            Submitted by: jtn
            Submitted on: Sat 19 Apr 2014 17:32:58 BST
                Category: None
                Severity: 3 - Normal
                Priority: 5 - Normal
                  Status: Need Info
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
        Operating System: Any
         Planned Release: 



While investigating bug #21932 I came across this in server-side

    case ORDER_FULL_MP:
      if (punit->moves_left != unit_move_rate(punit)) {
        /* If the unit doesn't have full MP then it just waits until the
         * next turn.  We assume that the next turn it will have full MP
         * (there's no check for that). */
        punit->done_moving = TRUE;
        /* ... */

The != condition looks like it's intended for the common case where moves_left
< move_rate, but it looks suspicious to me in the case where a unit's
moves_left is _greater_ than its current move_rate (due to the loss this turn
of some Move_Bonus effect from wonder or tech loss). The unit will waste its
current excess of movement points sitting around doing nothing.

On the other hand, surely the client-side pathfinding algorithm wouldn't have
inserted ORDER_FULL_MP in any such case for the current turn, so it seems
harmless. (Indeed, this check should never fail for input from the pathfinding
algorithm, I'd have thought.)

And if a unit's move rate reduces, any pre-calculated orders are potentially
dangerously wrong, for fueled units. So it's not clear to me what would be
better to put here. (Arguably we should try to cancel orders of units whose
move rate reduces.)

Raising the bug to get others' opinion; it might well get closed Wont Fix or


Reply to this item at:


  Message sent via/by Gna!

Freeciv-dev mailing list

Reply via email to