1
0
mirror of https://github.com/soarqin/DSP_Mods.git synced 2025-12-09 06:13:36 +08:00

code cleanup

This commit is contained in:
2023-12-14 21:52:35 +08:00
parent aa5d8a2454
commit 51f35bb573
28 changed files with 318 additions and 466 deletions

View File

@@ -233,7 +233,7 @@ public static class FactoryPatch
}
var labels = matcher.Labels;
matcher.Labels = new List<Label>();
matcher.Labels = [];
matcher.Insert(
new CodeInstruction(OpCodes.Ldarg_0).WithLabels(labels),
new CodeInstruction(OpCodes.Ldfld, AccessTools.Field(typeof(BuildTool), nameof(BuildTool.factory))),
@@ -608,7 +608,7 @@ public static class FactoryPatch
_portalFrom[v] = number;
if (!_portalTo.TryGetValue(number, out var set))
{
set = new HashSet<long>();
set = [];
_portalTo[number] = set;
}
@@ -1166,7 +1166,7 @@ public static class FactoryPatch
new CodeMatch(OpCodes.Stfld, AccessTools.Field(typeof(PowerGeneratorComponent), nameof(PowerGeneratorComponent.capacityCurrentTick)))
);
var labels = matcher.Labels;
matcher.Labels = new List<Label>();
matcher.Labels = [];
matcher.Insert(
// if (this.fuelMask == 4)
new CodeInstruction(OpCodes.Ldarg_0).WithLabels(labels),