Open Vectorial1024 opened 1 year ago
Hi, I just had this issue also. For me, it was because of the new Planetary Ruins feature, and the fact it has new settings associated with it. Deleting my old RealRuins config file (Mod_1552146295_RealRuins_Mod.xml
in ...\AppData\LocalLow\Ludeon Studios\RimWorld by Ludeon Studios\Config
in my case) and letting it regenerate seemed to fix the issue.
This issue occurs because Scribe_Deep.Look has null as the default value if the node is not present. Thus for any user with an outdated config file, the field gets reset to null when loading the options.
The easiest way to solve it is to add something like this to the end of RealRuins_ModSettings.ExposeData:
if (Scribe.mode == LoadSaveMode.LoadingVars) {
if (defaultScatterOptions == null) {
defaultScatterOptions = new ScatterOptions();
}
if (planetaryRuinsOptions == null) {
planetaryRuinsOptions = new PlanetaryRuinsOptions();
}
}
Depending on the exact C# version, we could potentially simplify further using the ??=
operator; ref https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/null-coalescing-operator
Describe the bug Something went wrong while generating the world (insert seeds, etc -> generate world -> error); most probably related to this mod.
To Reproduce Steps to reproduce the behavior:
Expected behavior Should just show the planet screen.
Error Logs