Jump to content

Welcome to the Forum!

The best place to exchange builds and ideas! Vote for the best ideas and suggestions here.

Join the Avorion Discord!

Connect with other passionate players and talk about the latest news.

Update 2.0 Out Now!

Update 2.0 now available! Check out the ton of QoL Features, improvements, captains, new commands and reworked UI!

[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

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