Closed NathanKell closed 1 year ago
Update: Gonna ship this patch in RP-1 and let it bake for a week or two before making it in KSPCF. @gotmachine can do it as a transpiler when he has time, I'm just gonna prefix.
https://github.com/KSP-RO/RP-1/commit/b8ef7ba526d789b1c7d0267bc84c4cccd7e20fb2
GetUniversalTime is supposed to detect when it's invalid and return
HighLogic.CurrentGame.UniversalTime
but at some point Planetarium started running in the editor which means its check forfetch == null
returns false, so it still tries to get UT from its instance. But the instance has the UT from before the last revert, rather than from the current game.Fix: Make the check
fetch == null || HighLogic.LoadedSceneIsEditor
. RP-1 has used this check for a long time (with its own wrapper for GetUniversalTime) and it's been fine, but there's plenty of code--including stock code--that assumes GetUniversalTime is correct.Brought to my attention by https://github.com/KSP-RO/RP-1/issues/2067 (because StrategySystem's Update runs in the editor, because of course it does).