Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mission list error when opened during hyperspace #5843

Merged
merged 2 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions data/meta/CoreObject/Player.meta.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,22 @@ package.core["Player"] = Player

-- TODO: document methods as required

---@return Body?
function Player:GetNavTarget() end

---@param body Body?
function Player:SetNavTarget(body) end

---@return Body?
function Player:GetCombatTarget() end

---@param target Body?
function Player:SetCombatTarget(target) end

---@return SystemPath?
function Player:GetHyperspaceTarget() end

---@param target SystemPath
function Player:SetHyperspaceTarget(target) end

return Player
2 changes: 1 addition & 1 deletion data/pigui/modules/info-view/04-missions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ local function makeMissionRows()
locationName = mission.location:GetSystemBody().name .. ", " .. locationName
end

local playerSystem = Game.system or Game.player:GetHyperspaceTarget()
local playerSystem = Game.system or Game.player:GetHyperspaceTarget():GetStarSystem()
local days = math.max(0, (mission.due - Game.time) / (24*60*60))

-- Use AU for interplanetary, LY for interstellar distances
Expand Down