[Freeciv-tickets] [freeciv] #48739: actres_possible() should iterate unit cargo, not tile units

Back to archive index
OSDN Ticket System norep****@osdn*****
Thu Sep 28 15:03:07 JST 2023


#48739: actres_possible() should iterate unit cargo, not tile units

  Open Date: 2023-09-28 09:03
Last Update: 2023-09-28 09:03

URL for this Ticket:
    https://osdn.net//projects/freeciv/ticket/48739
RSS feed for this Ticket:
    https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=48739

---------------------------------------------------------------------

Last Changes/Comment on this Ticket:
2023-09-28 09:03 Updated by: cazfi
 * New Ticket "actres_possible() should iterate unit cargo, not tile units" created


---------------------------------------------------------------------
Ticket Status:

      Reporter: cazfi
         Owner: (None)
          Type: Patches
        Status: Open
      Priority: 5 - Medium
     MileStone: (None)
     Component: Server
      Severity: 5 - Medium
    Resolution: None
---------------------------------------------------------------------

Ticket details:

actres_possible()  ACTRES_MOVE_UNIT handling:
    /* We cannot move a transport into a tile that holds
     * units or cities not allied with ani of our cargo. */
    if (get_transporter_capacity(actor->unit) > 0) {
      unit_list_iterate(unit_tile(actor->unit)->units, pcargo) {
        if (unit_contained_in(pcargo, actor->unit)
            && (is_non_allied_unit_tile(target->tile, unit_owner(pcargo))
                || is_non_allied_city_tile(target->tile,
                                           unit_owner(pcargo)))) {
           return TRI_NO;
        }
      } unit_list_iterate_end;
    }
That should be simply iteration over actor's cargo.

-- 
Ticket information of Freeciv project
Freeciv Project is hosted on OSDN

Project URL: https://osdn.net/projects/freeciv/
OSDN: https://osdn.net

URL for this Ticket:
    https://osdn.net/projects/freeciv/ticket/48739
RSS feed for this Ticket:
    https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=48739



More information about the Freeciv-tickets mailing list
Back to archive index