X Tutup
Skip to content

Update mission status if overdue#6258

Merged
sturnclaw merged 1 commit intopioneerspacesim:masterfrom
robothauler:overdue
Jan 2, 2026
Merged

Update mission status if overdue#6258
sturnclaw merged 1 commit intopioneerspacesim:masterfrom
robothauler:overdue

Conversation

@robothauler
Copy link
Contributor

Closes #6201
I added all the modules where I think it is safe to do so.

Copy link
Member

@sturnclaw sturnclaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the MissionUtils portion depends on the due key in the mission table, I'd recommend moving the if Game.time < mission.due portion into FailedWhenOverdue. Additionally, is there any validation to determine the mission status is a non-complete state, i.e. checking for the current state to be ACTIVE?

Separately, I'd recommend a more descriptive name of what's being accomplished inside the FailedWhenOverdue state. A verb would be appropriate here, such as TrackMissionDueState or SetupOverdueTimer. My main concern is that it's very difficult to tell what's actually happening inside the function, as well as whether the function is appropriate to call multiple times (or that it has to be called post-load). Both of the proposed name changes are directive, and the latter indicates that it's registering a timer (which is itself transient state and therefore has to be restored when loading a saved game).

@robothauler
Copy link
Contributor Author

During testing I noticed that missions[#missions] sometimes return nil. I do not understand this, but it should now be more robust for this edge case.

@robothauler
Copy link
Contributor Author

Additionally, is there any validation to determine the mission status is a non-complete state, i.e. checking for the current state to be ACTIVE?

In my opinion, the modules are too different. The module must decide for itself what is still active.

Copy link
Member

@sturnclaw sturnclaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me, thanks for reducing the amount of duplicated functionality in the mission modules!

A potential extension to this functionality is for the mission module which registered the timer to receive a callback when one of its missions fails for being overdue (I suspect this would allow the other mission modules to hook their custom logic into the function). I have a prototype which enables that sort of message-passing in a branch I'm working on, but it's unlikely to make this release window.

@sturnclaw sturnclaw merged commit 2f69503 into pioneerspacesim:master Jan 2, 2026
@robothauler robothauler deleted the overdue branch January 19, 2026 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mapping missions don't get the status "failed"

2 participants

X Tutup