SSTU - Shadow Space Technologies Unlimited

SSTU - Shadow Space Technologies Unlimited

98.5k Downloads

Custom Upper Stage - NRE spam in editor

blowfishpro opened this issue ยท 3 comments

commented

Steps to reproduce

  • Build a craft using the the custom upper stage (only the one part will suffice)
  • Launch the craft
  • Revert to the editor
  • NREs now spam
  • If you manage to get rid of the part, placing any new custom upper stage will cause the same NRE spam
NullReferenceException: Object reference not set to an instance of an object
  at SSTUTools.SSTUNodeFairing.updateFromExternalData (SSTUTools.FairingUpdateData eData) [0x00000] in <filename unknown>:0 

  at SSTUTools.SSTUNodeFairing.LateUpdate () [0x00000] in <filename unknown>:0 
commented

I think I did see an NRE related to SelectableNodes at some point, but I couldn't reproduce it, and I lost the original stack trace.

commented

Is there anything else with that log?

I'm asking as there is very little that could null-ref in the method pointed at (updateFromExternalData). However I did just find/fix a similar issue involving the SelectableNodes module in the MFT code, and expect that this is a similar problem.

Edit: Beginning to -really- hate the fairing code / multi-module interaction. It is most certainly the single feature that I find I have to spend the most time fixing / keeping working. Honestly, I need to merge the fairing code into the other modules that need it (MFT, MUS, MEC), and leave the stand-alone fairing to do its thing, as it works/worked perfectly before all the cross-module interaction garbage; and there would be no problems if the fairing code was local in the modules that needed it (all of these problems stem from cross-module interaction and the 100% inconsistent loading sequence KSP has, combined with its complete lack of proper multi-pass loading).

So... I guess this week I'll be reworking the fairing code.. yet again...

commented

From testing -- it is actually the selectable nodes module that is triggering the chain of nul-refs; something is calling it to update its node positions before it is initialized; thanks KSP for your wonderfully inconsistent loading-sequences.

Have -fixed- the problem as it occurs now, but there is something more insidious going on that I am going to need to tackle in the near future (out-of-sequence editor-modified-events being fired...and responded to....it should be impossible for it to receive an event before it has subscribed to it...). However, I'm going to save that as part of the 1.1 updates (as it will likely be craft/save breaking)