KSP-RO / ContractConfigurator

A config file based solution for creating new contracts for Kerbal Space Program.
https://forum.kerbalspaceprogram.com/index.php?/topic/91625-1
Other
8 stars 10 forks source link

Fixed Rendezvous Parameter check not honoring disableOnStateChange=false #34

Closed IO5 closed 9 months ago

IO5 commented 9 months ago

I noticed Rendezvous Parameter not turning incomplete when I get away from a target vessel, even though I had disableOnStateChange set to false.

After debugging for a bit: OnUpdate() gets called even on a disabled parameter, but there's actually no code path that sets the parameter back to incomplete.

I added that and also a check for .Enabled at the begining of OnUpdate() since there's isn't much point in checking the distance if the parameter can't change state.

siimav commented 9 months ago

After debugging for a bit: OnUpdate() gets called even on a disabled parameter, but there's actually no code path that sets the parameter back to incomplete.

I'm having a hard time believing that. My understanding is that when disableOnStateChange is true then the enabled field gets changed to false and thus OnUpdate() no longer gets called either.

IO5 commented 9 months ago

I'm having a hard time believing that. My understanding is that when disableOnStateChange is true then the enabled field gets changed to false and thus OnUpdate() no longer gets called either.

You're right. I was testing with Rendezvous as a child of VesselParameterGroup which alters the normal disableOnStateChange logic. I'll revert that line.