Follow-up Comment #5, 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.

Looking for pf_map_move_cost(), I could only find two examples, neither of
which seemed to map directly to this situation (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

I used pft_fill_unit_attack_param() because that's the best match to the logic
for the old checks.  Land units only check if it's the same continent, so for
classic land units, this should be the same as anywhere they can attack.  Sea
units check for it being a connected ocean OR a city OR being able to attack
non-native, which is similar to the logic for sea attack moves.  Note that
goto_is_sane() is mostly used as a gating function: that it still doesn't
promise that something is entirely possible isn't worse than before (and in a
fuller optimisation, goto_is_sane() would probably go away entirely: the
majority of callers use some sort of pathfinding anyway, so don't need it, and
the remainder would be better served by a pathfinding convenience function:
bool path_exists_for_unit_to_tile() or similar).


Reply to this item at:


  Message sent via/by Gna!

Freeciv-dev mailing list

Reply via email to