Here's are a bunch of fixes for a rather specific series of subsystem bugs that have (especially) been plaguing the WCS and TBP teams. The bug was caused by having a ship in the mission file with a subsystem called Engine and being able to change to a ship in loadout that had a name like Engine01 etc. The problem was that if a SEXP did anything to the Engine subsystem it would then crash when it came across Engine01.
The bug affected several SEXPs including
ship-subsys-guardian-threshold (where it was first noticed)
hits-left-subsystem
distance-subsystem
set-scanned/unscanned
is-ai-class
sabotage/repair-subsystem
set-subsystem-strength
set-cargo
ship-subsys-targetable/untargatable
change-subsystem-name
Some of those would crash in retail, some only in debug while others simply give the wrong answer or do nothing. The solution to some of those problems was to add a new <all engines> and <all turrets> option to those SEXPs. For some of the others I can stop them crashing but there is no sensible way to make them give an answer (How do you give a sensible answer for distance-subsystem when you change from a ship with one engine to a ship with multiple engines!).
Anyway since this is a fairly widespread change it needs some heavy testing (especially for but not limited to people who do actually use those SEXPs on player ships), so I'm posting a build
here. If you get bugs you can't reproduce in chief's build tell me.