ferram4 / Ferram-Aerospace-Research

Aerodynamics model for Kerbal Space Program
Other
239 stars 131 forks source link

RealChuteLite throws NRE from RealChuteFAR.OnLoad during MM Database Reloads #133

Closed DeputyLOL closed 8 years ago

DeputyLOL commented 8 years ago

With FAR installed, trying to reload the database in-game leads to it getting stuck at 77% and the log full of: [LOG 10:12:03.347] [ModuleManager] Ran in 5.806s [LOG 10:12:03.399] [ModuleManager] Ran in 5.806s [LOG 10:12:03.453] [ModuleManager] Ran in 5.806s [LOG 10:12:03.500] [ModuleManager] Ran in 5.806s [LOG 10:12:03.554] [ModuleManager] Ran in 5.806s [LOG 10:12:03.605] [ModuleManager] Ran in 5.806s [LOG 10:12:03.658] [ModuleManager] Ran in 5.806s [LOG 10:12:03.710] [ModuleManager] Ran in 5.806s [LOG 10:12:03.759] [ModuleManager] Ran in 5.806s [LOG 10:12:03.807] [ModuleManager] Ran in 5.806s [LOG 10:12:03.851] [ModuleManager] Ran in 5.806s [LOG 10:12:03.899] [ModuleManager] Ran in 5.806s

MM gets stuck at 77% and never finishes reloading. Trying to enter any building or flight immediately cause all ships and parts to disappear.

The only was to reload the database is to restart the game.

At first I thought it was another mod but the problem persisted until I removed FAR, then MM worked perfectly.

Another (unrelated) thing worth mentioning while I'm here. If you have 2 wings that are close together (Stock A300 wings) they provide no lift at all because they are 'shielded' by each other. While this does make sense for some situations, at least one of the two wings should be creating lift because they have air flowing either over or under them. I like using those wings because they look awesome and it allows me to hide more fuel tanks in them.

ferram4 commented 8 years ago

Okay, I can confirm the issue. @StupidChris roping you in because this is a RCL issue. I think it's breaking trying to access part.partInfo.partPrefab. If that's what's wrong, then either we need a workaround or have to see if there's an issue in MM itself.

ChrisViral commented 8 years ago

I'll take a look later when I fix the other issue

blowfishpro commented 8 years ago

I don't think this is an MM issue. When parsing a part from the database, KSP creates all the modules before it assigns partInfo.

It looks like maybe there's an assumption here that loading a part for the first time will only be done in the loading screen, which evidently MM database reloads will violate.

ChrisViral commented 8 years ago

@blowfishpro yep, that also is the conclusion I came to. Testing a fix as we're speaking.

ChrisViral commented 8 years ago

Fixed in 57d8e04, however the bug is still present in RealChute itself, I'll have to apply the same fix on my side. Shouldn't be any problems with pure FAR however.

DeputyLOL commented 8 years ago

Seems to be working now thanks, although the log is still being spammed by the; "[LOG 10:12:03.399] [ModuleManager] Ran in 115.44s" with FAR installed.

ChrisViral commented 8 years ago

Couldn't reproduce that over here, sorry. Worked perfectly fine with the bugfix. Do you have RealChute v1.4 installed?

DeputyLOL commented 8 years ago

no. That log spam only occurs when the database is reloading and appears in-between other log entries so it might just be nothing. It doesnt seem to be affecting anything so I it can be ignored.

ChrisViral commented 8 years ago

That appears to be MM normal behaviour.