Summary: Cleanups in dai_is_unit_tired_waiting_boat()
                 Project: Freeciv
            Submitted by: persia
            Submitted on: Mon 23 Jun 2014 09:50:19 AM 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



This function was using continental comparison and move_type analysis to
determine if a unit was capable of going to a destination with some
inaccuracy.  The attached patch replaces this with a call to goto_is_sane (a
function specifically designed to handle this sort of question).

While editing the function, I noticed a conditional commented to indicate it
was checking whether the unit was on it's home continent, but which actually
checked whether the unit was in it's home city, which I've adjusted to check
continent (this function is generally called to establish trade routes, and if
a unit is already on a different continent, it may as well establish a route
there, rather than trying to catch a boat and go somewhere else).


File Attachments:

Date: Mon 23 Jun 2014 09:50:19 AM JST  Name:
dai_is_unit_tired_waiting_boat-cleanups.patch  Size: 1kB   By: persia



Reply to this item at:


  Message sent via/by Gna!

Freeciv-dev mailing list

Reply via email to