URL:
  <http://gna.org/bugs/?24663>

                 Summary: Speculative homecity not fully respected
                 Project: Freeciv
            Submitted by: cazfi
            Submitted on: Thu 12 May 2016 04:01:58 PM EEST
                Category: general
                Severity: 3 - Normal
                Priority: 5 - Normal
                  Status: None
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
                 Release: 
         Discussion Lock: Any
        Operating System: None
         Planned Release: 
 Contains string changes: None

    _______________________________________________________

Details:

cowt_callback() (and maybe some other AI code) tries to speculate on changing
the caravan homecity before heading for a ACTION_TRADE_ROUTE mission. That is;
it would want to know value of traderoute between parameter->src and
parameter->dest, as given by get_discounted_reward(), and not between current
unit->homecity and parameter->dest.
get_discounted_reward() calls is_action_enabled_unit_on_city() that internally
checks the trade route legality based on units current homecity.

To support also future speculative cases, this would probably be best to
correct by renaming full implementation of is_action_enabled_unit_on_city()
under a new name and to make that function to take unit homecity as a
parameter. The usual is_action_enabled_unit_on_city() could then be just a
wrapper around it, passing unit's current homecity.




    _______________________________________________________

Reply to this item at:

  <http://gna.org/bugs/?24663>

_______________________________________________
  Message sent via/by Gna!
  http://gna.org/


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

Reply via email to