Update of bug #22136 (project freeciv):

                  Status:                    None => Ready For Test         
         Planned Release:                         => 2.5.0, 2.6.0           


Follow-up Comment #2:

I found a bunch of bugs investigating for this one:
* At the end of update_unit_activity(), there are some very old lines (I think
they are obsolete):

  unit_list_iterate(ptile->units, punit2) {
    if (!can_unit_continue_current_activity(punit2))
      unit_activity_handling(punit2, ACTIVITY_IDLE);
  } unit_list_iterate_end;

** There is no reason to have these lines, as illegal activities are already
supposed to be caught above...
** Using unit_activity_handling() clears silently the orders of the units.
* They are some erroneous piece of codes which looks to:

        unit_list_iterate (ptile->units, punit2) {
          if (punit2->activity == ACTIVITY_BASE
              && punit->activity_target == punit2->activity_target) {
            set_unit_activity(punit2, ACTIVITY_IDLE);
            send_unit_info(NULL, punit2);
        } unit_list_iterate_end;

But 'punit' can be iterated as 'punit2'. So units which will be iterated after
'punit' can still do the base activity because 'activity_target' has been
overwritten. But thanks to the previous item, this case was handled nearly
* There is no reason to check adjacent units if no activity was done.


The attached patches should fix a part of the problem. But to be completed, we
should also apply patch #4807.


> I wondered whether not setting done_moving here in
> execute_orders(), like we do everywhere else, might be
> significant [...] but it made no difference. Perhaps we should
> fix it anyway, although I think it's probably harmless at the
> moment (unless I've missed some reason why it's deliberate).

I don't think this could change anything because unit already has no moves

(file #21043, file #21044)

Additional Item Attachment:

File name: trunk_update_unit_activity.patch Size:6 KB
File name: S2_5_update_unit_activity.patch Size:4 KB


Reply to this item at:


  Message posté via/par Gna!

Freeciv-dev mailing list

Reply via email to