linuxgurugamer / KerbinSpaceStation

A contract pack for KSP, designed to replace the current Space Station Missions
Other
4 stars 8 forks source link

Fix SSPXr compatibility #18

Closed zhangyuesai closed 7 months ago

zhangyuesai commented 7 months ago

StationCoreCombined.cfg checks if SSPXr is installed; if so, it adds a requirement "Include a station core and a habitat" to the comtract. However, the code isn't quite right. An error will occur if SSPXr is installed, making the most basic contract unable to be loaded:

[LOG 23:17:50.958] [INFO] ContractConfigurator.ContractType: Loading CONTRACT_TYPE: 'StationCoreCombined'
[ERR 23:17:50.979] ContractConfigurator.PartValidationFactory: CONTRACT_TYPE 'StationCoreCombined', PARAMETER 'PartValidHab' of type 'PartValidation': unexpected node 'PARAMETER'.

[WRN 23:17:50.987] ContractConfigurator.ContractType: Errors encountered while trying to load CONTRACT_TYPE 'StationCoreCombined'
[LOG 23:17:50.990] [INFO] ContractConfigurator.ContractConfigurator: Loaded 19 out of 20 CONTRACT_TYPE nodes.

This PR fixes this issue. The logic is:

I've tested the fix and it works for all occasions (SSPXr is installed or not / Tokamak is installed or not).

linuxgurugamer commented 7 months ago

thank you