1
0
mirror of https://github.com/soarqin/DSP_Mods.git synced 2026-05-09 13:47:11 +08:00

crash fix

This commit is contained in:
2026-04-27 23:09:16 +08:00
parent 19629eae97
commit ca4244384c

View File

@@ -446,7 +446,9 @@ public class FactoryPatch : PatchImpl<FactoryPatch>
{
var time = __instance.timei;
if (time % 6 != 0) return;
var factory = GameMain.localPlanet?.factory;
var planet = GameMain.localPlanet;
if (planet == null || !planet.factoryLoaded) return;
var factory = planet.factory;
if (factory == null || factory.prebuildCount <= 0) return;
var player = GameMain.mainPlayer;
if (player == null) return;