Summary: Use UCF_MISSILE to identify missiles for pathfinding
                 Project: Freeciv
            Submitted by: persia
            Submitted on: Mon 29 Apr 2013 07:29:48 PM JST
                Category: ai
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: 



The current code uses the combination of UTYF_ONEATTACK and fuel==1 to
determine that a given fueled unit is a missile.  This is suboptimal, as it
causes units that don't need to die in the attack consider suicide an
acceptable option, which ought be something done purposefully, rather than as
a side-effect of pathfinding being confusing.

This patch changes the two places that are checks for missiles to use
UCF_MISSILE instead.  For the pf_fuel_map_iterate() hunk, I'm not entirely
sure why the "|| 0 >= moves_left" check exists, so I've left it, but I suspect
it of causing AI missiles not to attack as much as they might.  Explanations
or suggestions to drop welcomed.

One side effect of this patch is that units that are UTYF_ONEATTACK, have fuel
== 1, and are not UCF_MISSILE will only attack from pathfinding when they are
currently on a refueling point (which I think appropriate, but some ruleset
author might consider unexpected).


File Attachments:

Date: Mon 29 Apr 2013 07:29:48 PM JST  Name:
use-UCF_MISSILE-for-missile-ID.patch  Size: 2kB   By: persia



Reply to this item at:


  Message sent via/by Gna!

Freeciv-dev mailing list

Reply via email to