mirror of
https://github.com/soarqin/DSP_Mods.git
synced 2026-02-04 15:12:17 +08:00
bug fix
This commit is contained in:
@@ -263,6 +263,19 @@ public static class PlanetFunctions
|
||||
factory.factoryStorage = new FactoryStorage(planet);
|
||||
factory.powerSystem = new PowerSystem(planet);
|
||||
factory.constructionSystem = new ConstructionSystem(planet);
|
||||
if (factory.veinPool != null)
|
||||
{
|
||||
for (var i = 0; i < factory.veinPool.Length; i++)
|
||||
{
|
||||
ref var vein = ref factory.veinPool[i];
|
||||
if (vein.id != i) continue;
|
||||
vein.minerCount = 0;
|
||||
vein.minerId0 = 0;
|
||||
vein.minerId1 = 0;
|
||||
vein.minerId2 = 0;
|
||||
vein.minerId3 = 0;
|
||||
}
|
||||
}
|
||||
factory.InitVeinHashAddress();
|
||||
factory.RecalculateAllVeinGroups();
|
||||
factory.InitVegeHashAddress();
|
||||
|
||||
@@ -122,6 +122,7 @@ public class UIPatch : PatchImpl<UIPatch>
|
||||
#region Helper functions
|
||||
private static void ProcessVeinData(VeinTypeInfo[] veinCount, VeinData[] veinPool)
|
||||
{
|
||||
if (veinPool == null) return;
|
||||
lock (veinPool)
|
||||
{
|
||||
foreach (VeinData veinData in veinPool)
|
||||
@@ -272,15 +273,14 @@ public class UIPatch : PatchImpl<UIPatch>
|
||||
}
|
||||
foreach (PlanetData planet in __instance.star.planets)
|
||||
{
|
||||
if (planet.runtimeVeinGroups == null) { continue; }
|
||||
PlanetFactory factory = planet.factory;
|
||||
if (factory != null)
|
||||
{
|
||||
ProcessVeinData(starVeinCount, factory.veinPool);
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
VeinGroup[] veinGroups = planet.runtimeVeinGroups;
|
||||
VeinGroup[] veinGroups = planet.veinGroups;
|
||||
if (veinGroups == null) continue;
|
||||
lock (planet.veinGroupsLock)
|
||||
{
|
||||
for (int i = 1; i < veinGroups.Length; i++)
|
||||
@@ -289,7 +289,6 @@ public class UIPatch : PatchImpl<UIPatch>
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// update each resource to show the following vein group info:
|
||||
// Iron: <number of vein groups with miners> / <total number of vein groups>
|
||||
foreach (UIResAmountEntry uiresAmountEntry in __instance.entries)
|
||||
|
||||
Reference in New Issue
Block a user