I might be missing something but doesn't New Cargoes already apply penalties on docking without a permit with
this.importPenalty
? If that's the case isn't the simplest solution to have Illegal Goods Tweak check for special cargo that is "slaves", "narcotics" or "firearms", tot up the total quantities for each main cargo type, and then ignore that amount when calculating it's own penalties, calculating the manifest when handing over cargo to customs etc, irrespective of permit status, and let new cargoes handle any penalties without interference?
I've added that functionality into illegal goods tweak for the main hold, and a brief test seems to indicate it's working fine.
Or do you want illegal goods tweak to be asking players to hand over their specialCargo in these categories to avoid penalties when there isn't a permit or there is a specific ban?
Edit:
OK - I think the penny has dropped - If there is special cargo and the new function returns anything but all 0's illegal goods tweak should ignore it entirely, if not it can be treated as normal cargo as far as Illegal Goods Tweak goes apart from when updating the manifest when handing over goods to customs I guess I'd need to callI think what I'll need to do is add importPermitDetails which gives an array of the legal status modifiers rather than the total, for this situation. You'd then only apply IGT treatment to cargo which had a full array of zeros (and was therefore from the system's perspective identical to generic cargo).
this.removeSpecialCargo
as-well?