Follow-up Comment #6, patch #4643 (project freeciv):

> The code is full of function pointers, so I'm sure I'm missing
> something, but how and where is PF_IMPOSSIBLE_MOVE checked? I'm
> happy to remove it, I just don't understand why I may.

pf_map_move_cost(), pf_map_position() and pf_map_path() do about the same
thing. Until the tile is not unreachable and not reached, the map is iterated.
(See pf_[normal|danger|fuel]_map_iterate_until() functions.)

The difference is what they return:
* pf_map_move_cost() return the total movement cost to reach the tile, or
PF_IMPOSSIBLE_MC if the tile is not reachable ; (See
pf_[normal|danger|fuel]_map_move_cost() functions.)
* pf_map_position() return TRUE iff the tile is reachable and then fill the
position ; (See pf_[normal|danger|fuel]_map_position() functions.)
* pf_map_path() return the complete path to reach the tile, or NULL is the
tile cannot be reached. (See pf_[normal|danger|fuel]_map_path() functions.)

> and in find_beachhead, I wonder if the ai is actively seeking
> PF_IMPOSSIBLE_MC with some of the conditionals (cost <
> best_cost, etc.), or if pf_map_move_cost() can't return that.

Checking this, it seems erroneous. If I understand correctly, if the first
tile iterated by adjc_iterate() is not reachable, the result will be wrong.


    _______________________________________________________

Reply to this item at:

  <http://gna.org/patch/?4643>

_______________________________________________
  Message posté via/par Gna!
  http://gna.org/


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

Reply via email to