Summary: Allow amphibious unit for kill_something_with()
                 Project: Freeciv
            Submitted by: persia
            Submitted on: Thu 26 Jun 2014 07:48:22 PM JST
                Category: ai
                Priority: 5 - Normal
                  Status: Ready For Test
                 Privacy: Public
             Assigned to: persia
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: 2.6.0



kill_something_with() (and the embedded process_attacker_want) restricted
itself to units that were UMT_LAND or UMT_SEA.  The attached patch generalises
this, although not completely.

Entirely gen-move compliant fixes are using unit nativity rather than
move_type and a "shore" boolean to determine if one can reach a target, and
using the potential_charges cache from gen-move bodyguards to determine if one
can chase a target (rather than a matching move_type).

A reasonably future-safe change was using dai_is_ferry_type() to determine if
the unit in question was a ferry, rather than checking UMT_SEA: the underlying
function still uses adv.sea_move and adv.land_move, but this change
centralises that logic.

In other cases, I defaulted to adv.sea_move and adv_land_move temporarily, as
this data is more reliable for UMT_BOTH units than the assumptions usually
carried by that move_type.  While this does introduce more use of this data,
the results using these values are more accurate than with move_type for
scenarios with complex nativity.  I hope to remove these entirely over time,
but understanding that enough to do it properly doesn't fit in this patch.


File Attachments:

Date: Thu 26 Jun 2014 07:48:22 PM JST  Name:
allow-amphibious-unit-for-kill_something_with.patch  Size: 9kB   By: persia



Reply to this item at:


  Message sent via/by Gna!

Freeciv-dev mailing list

Reply via email to