<URL: http://bugs.freeciv.org/Ticket/Display.html?id=40536 >

I changed completely my initial mind to fix the last strange behaviour I
observed. I rewrote the nearly-whole path_finding.c file. Some words
about this new code:

* struct pf_map is a base structure, containing only the mode it is
used. There are 3 modes: PF_NORMAL (in the most of the cases), PF_DANGER
(like old danger code) and PF_FUEL (for fueled units which returns
automatically to refuel. The real derived structures are named
pf_normal_map, pf_danger_map and pf_fuel_map. The classical pf functions
are keep and just wrap to the specific functions of the mode. All
specific function have the pf_normal_*, pf_danger_* and pf_fuel_* prefixes.

* The mode PF_FUEL is different of PF_DANGER because it doesn't say if a
tile is dangerous or not. It tries to find the closest refuel point and
deduce the minimum moves left a unit needs to reach this position.

* The function pf_fuel_map_iterate takes care of refueling, including
the case the unit with 2 fuel turns, for example, could refuel in the
odd turns.

* For attacking, the found path should be the one which requires the
less of moves, also for retreat after attacking.

* Added some 'const' flag to some callbacks.

I made this patch for trunk only. I think it's too important changes for
2.1. Thank you for testing and finding new bugs.

Attachment: trunk_airgoto.diff.gz
Description: GNU Zip compressed data

_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to