mirror of
https://github.com/soarqin/DSP_Mods.git
synced 2025-12-09 02:13:29 +08:00
force inline
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
using NebulaAPI;
|
using NebulaAPI;
|
||||||
|
|
||||||
@@ -159,6 +160,7 @@ public static class TankPatch
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
private static void TankComponentUpdateBelt(ref TankComponent thisTank, int belt, bool isOutput, ref CargoTraffic cargoTraffic, ref TankComponent[] tankPool)
|
private static void TankComponentUpdateBelt(ref TankComponent thisTank, int belt, bool isOutput, ref CargoTraffic cargoTraffic, ref TankComponent[] tankPool)
|
||||||
{
|
{
|
||||||
switch (isOutput)
|
switch (isOutput)
|
||||||
@@ -201,12 +203,14 @@ public static class TankPatch
|
|||||||
ref var lastTank = ref tankPool[targetTank.lastTankId];
|
ref var lastTank = ref tankPool[targetTank.lastTankId];
|
||||||
if (targetTank.fluidId != lastTank.fluidId)
|
if (targetTank.fluidId != lastTank.fluidId)
|
||||||
{
|
{
|
||||||
|
if (lastTank.id == thisTank.id || targetTank.fluidCount >= targetTank.fluidCapacity) return;
|
||||||
targetTank = ref lastTank;
|
targetTank = ref lastTank;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!targetTank.inputSwitch)
|
if (!targetTank.inputSwitch)
|
||||||
{
|
{
|
||||||
|
if (lastTank.id == thisTank.id || targetTank.fluidCount >= targetTank.fluidCapacity) return;
|
||||||
targetTank = ref lastTank;
|
targetTank = ref lastTank;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -229,12 +233,16 @@ public static class TankPatch
|
|||||||
var fluidId = targetTank.fluidId;
|
var fluidId = targetTank.fluidId;
|
||||||
if (fluidId != 0 && fluidId != lastTank2.fluidId)
|
if (fluidId != 0 && fluidId != lastTank2.fluidId)
|
||||||
{
|
{
|
||||||
|
if (lastTank2.id == thisTank.id || targetTank.fluidCount >= targetTank.fluidCapacity) return;
|
||||||
targetTank = ref lastTank2;
|
targetTank = ref lastTank2;
|
||||||
}
|
}
|
||||||
|
else if (!lastTank2.outputSwitch)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (targetTank.id == thisTank.id || targetTank.fluidCount >= targetTank.fluidCapacity || !lastTank2.outputSwitch ||
|
if (cargoTraffic.TryPickItemAtRear(belt, thisTank.fluidId, null, out stack, out inc) <= 0 || (bool)IsDustbinField.GetValue(targetTank)) return;
|
||||||
cargoTraffic.TryPickItemAtRear(belt, thisTank.fluidId, null, out stack, out inc) <= 0 || (bool)IsDustbinField.GetValue(targetTank)) return;
|
|
||||||
if (targetTank.fluidCount == 0)
|
if (targetTank.fluidCount == 0)
|
||||||
{
|
{
|
||||||
targetTank.fluidId = thisTank.fluidId;
|
targetTank.fluidId = thisTank.fluidId;
|
||||||
|
|||||||
Reference in New Issue
Block a user