[TM Probably] Sabre insanity, also known as one proc adjustment that might possibly fix stuff #2666
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
About The Pull Request
There is some bug going on with miner sabres sometimes getting nullspaced and I spent hours without finding out why. The one part of the entire proc chain that is basically always questionable is the weird ships[] list so I passed some better values for now and we'll see if that fixes it.
TM this please. We'll see if someone gets nullspaced with this and if someone does I go back to the mines.
Attendum
Did some more diving. Found one very specific edge case where a ship with a reserved z that docks somewhere can potentially send other ships in system who-knows-where.
Rewrote some of the remove_ship() code to hopefully make those cases less unsafe and applied it to cases where remove_ship is used to remove a ship from the overmap entirely as opposed to FTL-related things mostly.
Also made deletion of ships remove them from the system after all else is done, which should only impact situations where a z carrier ship is deleted.
Might be a bit more volatile now. Please look over this PR before updating its testmerge & make sure I'm not doing something weird. (I've not seen anything weird in my tests but better safe than sorry)
Why It's Good For The Game
Fix man good.
Changelog
🆑
fix: Possibly fixes some weird Sabre behavior.
fix: Also makes one single gun check of the plasma caster slightly safer.
fix: Fixes a weird edge case with docking behavior.
fix: Fixes remove_ship() assuming all remove_ship() calls were FTL based.
fix: Overmap objects when deleting have remove_ship() called for them (this should mostly only affect z carriers which drop their z or pass it to another ship).
fix: Overmap objects that are deleted now drop their current_system var.
/:cl: