Turn `Parse_names` into a vector and add SCP_string overloads of ship registry functions. Refactor calling code to use registry as appropriate. Remove an unused overload of `mission_parse_get_parse_object`.
This refactors the ship registry and the OSWPT struct to store data as indexes rather than pointers. This is a prerequisite for making these collections dynamic in the future. See also #5800.
* Make sure we handle unknown location types
Avoids edge-case gargabe pointer 1522974
* Make sure local vectors are at least set to zero
For coverity 1522985
* Make sure from_table is initialized
When creating a replacement texture object, for coverity 1522989
* Change to Unreachable to help Linters
This was a false positive uninitialized scalar, Coverity 1523726. Hopefully, changing to UNREACHABLE() will help linters avoid this false positive in the future.
* Initialize xyw on this struct instantiation
For coverity 1523730
* Add early return for ade_set_args if error
For coverity 1523732
1. The player can target other object types besides ships, so when creating an `object_ship_wing_point_team`, make sure it is a ship
2. A few recent mission features require a version bump, but not all missions use these features; so do a "soft bump" where the mission version is updated only if necessary
3. Remove an unneeded #include by adding a `struct team_data` declaration (see #5599)
Occasionally, FRED can save a mission with a wing's ships out of order; this can happen if ships are deleted and FRED finds a free index in the middle of the ship list. This can cause benign but confusing mismatches in the ship registry, the hotkey list, and other places -- and it's also possible some mismatches may not be so benign, e.g. in multiplayer. Anyway, it's better for the ships to appear in the order the wing expects them, so this adds a routine to swap them around if necessary.
There is a bit of code in missionparse that sets the parse object because in-game joining needs it. This is unrelated to ship status, so the status shouldn't be changed. This fixes the bug and adds a comment to clarify the situation, as well as some warnings to help track down incorrect joining states.
Fixes#5661. Follow-up to #5658 (where the regression was introduced) and #4836 (which fixed in-game joining).
The Star Fox barrel roll effect is achieved using a script which spawns a new ship. The script sets no-collide on this spawned ship, but it also tries to set the ship flag for all future ships -- and future ships require a parse object, which doesn't exist for a created ship. This patches the FALLTHROUGH in the sexp code to account for that possibility.
Separately, there are other ways a parse object pointer could become null through unusual code states, so this adds an INVALID status and several additional checks to defend against this crash in other circumstances.
This adds several fixes to make the event and menu music more robust:
1. The game will now run with zero soundtracks. All accesses into a potentially empty vector should now have checks.
2. Soundtracks and menu music are now checked for validity before being played (not just when importing a FSM mission).
3. The parsing validity checks and the in-game event music now check for skippable patterns using the same function.
4. Zero measures and zero samples-per-measure now cause the game to skip a pattern. Negative values now trigger a warning.
5. Omitting some or all of the `$Name:` lines for a soundtrack will not cause an assert.
Fixes#5576. Follow-up to #5572.
Supercaps use a physics flag on warpin that makes them slow down faster than they would under the normal physics code. This adds that flag as an option for custom warp parameters.
Since flags are not yet parsed when warp parameters are parsed, the code needs to skip ahead and peek at the flags in the same way as the weapon override.
Issue #5459 notes that mission files that are too long will crash the FRED campaign editor, but this is an artificial restriction. The only need for a string buffer here is to enforce the correct mission extension, so use a SCP_string for this, and add checks for whether string manipulation is in fact necessary. (In most cases it isn't.)
Fixes#5459.
In certain cases, angles would be rounded to 360, where the expected range is 0-359. The range was guarded properly for skyboxes but not for bitmaps and suns. This fixes that. Additionally, since suns do not bank, the angle conversion now sets the bank to 0.
Fixes#5390.
1. Deprecate the old set-jumpnode-name sexp now that there is a set-jumpnode-display-name
2. Make the display name design consistent with ships and weapons; in particular add a `HasDisplayName()` function and automatically generate the display name for hash-truncated names
3. Keep the display name in sync when the name is changed in the FRED dialog
4. Fix the overriding of hash-truncated names with display names on the HUD
5. Fix the incorrect setting of the alphacolor flag when using FRED
6. Fix array out-of-bounds access when no object is selected
Follow-up to #5401.
* refactor how asteroid wrapping is done and setup for allowing or disallowing range check
* allow fred to toggle enhanced spawn checking
* field naming adjustment
* some minor tweaks
* Add sexp compatibility
* We don't need to save the boolean, just the string.
* full qtFRED support