Ticket #48739

actres_possible() should iterate unit cargo, not tile units

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

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

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 History (1/1 Histories)

2023-09-28 15:03 Updated by: cazfi
  • New Ticket "actres_possible() should iterate unit cargo, not tile units" created

Attachment File List

No attachments

Edit

Please login to add comment to this ticket » Login