mirror of
https://github.com/soarqin/DSP_Mods.git
synced 2025-12-08 19:33:27 +08:00
fix issue
This commit is contained in:
@@ -204,13 +204,12 @@ public class LogisticMiner : BaseUnityPlugin
|
|||||||
}
|
}
|
||||||
|
|
||||||
[HarmonyPostfix]
|
[HarmonyPostfix]
|
||||||
[HarmonyPatch(typeof(GameLogic), nameof(GameLogic.FactoryBeforeGameTick))]
|
[HarmonyPatch(typeof(PlanetFactory), nameof(PlanetFactory.BeforeGameTick))]
|
||||||
private static void FactorySystemLogisticMiner(FactorySystem __instance)
|
private static void FactorySystemLogisticMiner(PlanetFactory __instance)
|
||||||
{
|
{
|
||||||
if (_miningSpeedScaleLong <= 0)
|
if (_miningSpeedScaleLong <= 0)
|
||||||
return;
|
return;
|
||||||
var factory = __instance.factory;
|
var planetId = __instance.planetId;
|
||||||
var planetId = factory.planetId;
|
|
||||||
lock (PlanetVeinCacheData)
|
lock (PlanetVeinCacheData)
|
||||||
{
|
{
|
||||||
if (PlanetVeinCacheData.TryGetValue(planetId, out var vcd))
|
if (PlanetVeinCacheData.TryGetValue(planetId, out var vcd))
|
||||||
@@ -227,9 +226,9 @@ public class LogisticMiner : BaseUnityPlugin
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var planetTransport = __instance.planet.factory.transport;
|
var planetTransport = __instance.transport;
|
||||||
var factoryProductionStat =
|
var factoryProductionStat =
|
||||||
GameMain.statistics.production.factoryStatPool[__instance.factory.index];
|
GameMain.statistics.production.factoryStatPool[__instance.index];
|
||||||
var productRegister = factoryProductionStat?.productRegister;
|
var productRegister = factoryProductionStat?.productRegister;
|
||||||
DeepProfiler.BeginSample(DPEntry.Miner);
|
DeepProfiler.BeginSample(DPEntry.Miner);
|
||||||
do
|
do
|
||||||
@@ -271,7 +270,7 @@ public class LogisticMiner : BaseUnityPlugin
|
|||||||
|
|
||||||
if (isVein)
|
if (isVein)
|
||||||
{
|
{
|
||||||
(amount, energyConsume) = vcd.Mine(factory, stationStore.itemId, miningScale,
|
(amount, energyConsume) = vcd.Mine(__instance, stationStore.itemId, miningScale,
|
||||||
_miningSpeedScaleLong,
|
_miningSpeedScaleLong,
|
||||||
stationComponent.energy);
|
stationComponent.energy);
|
||||||
if (amount < 0)
|
if (amount < 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user