Jump to content

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


Paulquappe

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
            end
        end
    end

 

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

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...