Skip to content

Specific scripting combinations can access invalid ships #7206

@BMagnu

Description

@BMagnu

In certain gamestates, notably on mission end and possibly on mission start after a quick restart only, seems to contain data that's invalid / not yet cleaned up / already cleaned up, leading to states like wings containing ships with an objnum of -1.
This seems to be no issue with how the engine operates, and seems pretty much by design.
It is possible however to hook scripting to run at this time. Base scripting will not operate on the resulting invalid handles, but calling evaluateSEXP with the respective shipnames will cause the custom SEXP system to try to create shiphandles for the invalid ship, causing a CTD.
There's a few approaches here.
For one, the LuaSEXP system should just not CTD if it gets called on an invalid ship.
Additionally, we should evaluate why there are invalid ships in wings on mission end, and if that makes sense at all.
Finally, the viability of evaluateSEXP being available at all after and before mission is questionable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions