LGhassen / EnvironmentalVisualEnhancements

Visual enhancements including clouds, lights, etc.
76 stars 9 forks source link

NullRef spam with CityLights emissives in the flight scene when using an MM patch #40

Closed WhirligigGirl closed 4 months ago

WhirligigGirl commented 4 months ago

WhirligigWorld uses EVE's CityLights emissives to show lava in volcanoes visible from the surface and in space.

In the KSC scene and in the flight scene, but not in the map view or tracking station, there is intense Nullref spam. It persists regardless of what celestial body you orbit. This is on the latest version.

There appears to be no ill effects. (I haven't noticed a performance drop, and the emissives appear exactly as they should. But the logspam is annoying at least, and I'm worried it could have a noticeable performance cost in lower end computers.)

Things I have tried that have not fixed it:

Things that do stop the logspam:

Mod list:

Here's the KSP log, showing what happens when I go to the space center, tracking station, flight scene, map view, and also flight scene and map view around an asteroid far away from any city lights.

KSP.log

And the relevant files can be found here: https://github.com/WhirligigGirl/Whirligig-World/tree/1b4d0e3b000da7df6125b83966bcaef313c3a40f/GameData/WhirligigWorld/ModCompatibility/Emissives

WhirligigGirl commented 4 months ago

I don't know why i didn't try this, but removing the following lines from the config file fixes the issue.

{
    #@WhirligigWorldSettings {}
}
@EVE_CITY_LIGHTS:HAS[@WhirligigWorldSettings:HAS[#Homeworld[Kerbmun]]]:AFTER[aWhirligigWorld]
{
    @OBJECT[Mesbin-Volcanoes]
    {
        @body = Mesbin
    }
}

this clones the user-alterable whirligig world settings file into EVE_CITY_LIGHTS so that it can check whether certain settings are true, then it changes the Mesbin Volcanoes to be on a body called Mesbin rather than a body called Kerbin; if the Kerbmun homeworld swap is enabled. The bug report is with Homeworld = Mesbin, so after MM patches, EVE is reading this:

image

So I need this here in order to provide user-configurable settings. It seems to me that there should be some check for nonsense in these configs. The only workaround, unless i can figure out a completely different method for MM, is to require the user change this manually if they're switching the homeworld, which I do not want to do.

WhirligigGirl commented 4 months ago

someone pointed out to me that I can just deleted the cloned settings node after i'm done using it. This solved the problem, at least for this particular case.

image