Jump to content
Sign in to follow this  

[1.0.1] Repair/Escort Target menu not filled on galaxy map

Recommended Posts

When issuing a "Escort/Repair Target" command, the respective menu is not filled with the possible targets in the target sector, but with those in the sector the selected craft is currently in.


Revision: r22541

Steps to reproduce:

- Open galaxy map

- Select sector (say, sector A) with controllable ships

- Select controllable ship

- Enchain multiple jump orders with ship (say ->B->C->D)

- Enchain "Repair Target" or "Escort Target"

- Now the menu displays targets from  sector A but not from sector D


Cause of failure:

MapCommands.fillTargetCombo in scripts/player/map/maproutes.lua only fetches coordinates for the current sector.



Partial Fix:

To get the coordinates for the target sector, append after the following line

    local x, y = GalaxyMap():getSelectedCoordinates()


this  code block (copied from MapCommands.updateTransitArea):

    if MapCommands.isEnqueueing() then
        local selected = MapCommands.getSelectedPortraits()
        if #selected > 0 then
            local ix, iy = MapCommands.getLastLocationFromInfo(selected[1].info)
            if ix and iy then
                x, y = ix, iy


However, in OrderChain.addEscortOrder in scripts/entity/orderchain.lua the names are resolved to entity IDs, which would fail here. So there would need to be something like "player:getNamesOfShipsInSector(x,y)" for IDs for this to work. Alternatively, the IDs could be resolved only in the end, when executing the order (CraftOrders.escortEntity) for this to work.



Edit: Noticed that my fix only solves half of the problem

Share this post

Link to post
Share on other sites
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Create New...