1
0
mirror of https://github.com/soarqin/DSP_Mods.git synced 2025-12-09 03:33:29 +08:00

CheatEnabler v2.2.5

This commit is contained in:
2023-09-27 21:23:23 +08:00
parent d48280c20c
commit c092ae81bb
7 changed files with 80 additions and 38 deletions

View File

@@ -256,7 +256,9 @@ public static class FactoryPatch
{
if (_sunlight == null)
{
_sunlight = GameMain.universeSimulator.LocalStarSimulator().sunLight;
var simu = GameMain.universeSimulator;
if (simu)
_sunlight = simu.LocalStarSimulator()?.sunLight;
if (_sunlight == null) return;
}
@@ -715,7 +717,9 @@ public static class FactoryPatch
_portalFrom = new Dictionary<long, int>();
_portalTo = new Dictionary<int, HashSet<long>>();
foreach (var factory in GameMain.data.factories)
var factories = GameMain.data?.factories;
if (factories == null) return;
foreach (var factory in factories)
{
var entitySignPool = factory?.entitySignPool;
if (entitySignPool == null) continue;