Skip to content

Commit 1c98782

Browse files
committed
Update 3.0.12
1 parent 94aa304 commit 1c98782

File tree

5 files changed

+29
-15
lines changed

5 files changed

+29
-15
lines changed

CHANGELOG.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
1-
- v3.0.11
2-
+ 修复了v3.0.9的上传速度调整导致的研究站工作不正常的问题
1+
- v3.0.12
2+
+ 粗略适配版本V0.10.31.24646
33

4-
+ Fixed issue that research lab work improperly due to upload speed adjustments in v3.0.9
4+
+ Adaptation of version v0.10.31.24646
55

66

77
<details>
88
<summary>点击展开日志 | Click to view all </summary>
99

1010

11+
- v3.0.11
12+
+ 修复了v3.0.9的上传速度调整导致的研究站工作不正常的问题
13+
14+
+ Fixed issue that research lab work improperly due to upload speed adjustments in v3.0.9
15+
16+
1117
- v3.0.10
1218
+ 调整了星球矿脉分布,增加了出生点的矿物类型和数量(仅对新存档生效)
1319
+ 调整了部分物品的位置

src/Patches/UI/BeltColorFix/BeltFixPatches.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ public static IEnumerable<CodeInstruction> CargoTraffic_SetBeltSelected_Transpil
4343
return matcher.InstructionEnumeration();
4444
}
4545

46-
[HarmonyPatch(typeof(BuildTool_BlueprintPaste), nameof(BuildTool_BlueprintPaste.UpdatePreviewModels))]
4746
[HarmonyPatch(typeof(BuildTool_BlueprintCopy), nameof(BuildTool_BlueprintCopy.UpdatePreviewModels))]
4847
[HarmonyPatch(typeof(BuildTool_Path), nameof(BuildTool_Path.UpdateGizmos))]
4948
[HarmonyTranspiler]

src/Patches/UI/FactoryModelPatches.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public static class FactoryModelPatches
1212
{
1313
private static Material atmosphericCollectStationMaterial;
1414

15-
[HarmonyPatch(typeof(FactoryModel), nameof(FactoryModel.InitCollectorMaterial))]
15+
[HarmonyPatch(typeof(FactoryModel), nameof(FactoryModel.InitMaterial))]
1616
[HarmonyPostfix]
1717
public static void FactoryModel_InitCollectorMaterial(FactoryModel __instance)
1818
{

src/Patches/UI/ResearchLabPatches.cs

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -407,33 +407,42 @@ public static IEnumerable<CodeInstruction> LabComponent_UpdateOutputToNext_Trans
407407
{
408408
var matcher = new CodeMatcher(instructions);
409409

410-
matcher.MatchForward(true, new CodeMatch(OpCodes.Ldarg_0),
411-
new CodeMatch(OpCodes.Ldfld, AccessTools.Field(typeof(LabComponent), nameof(LabComponent.needs))),
412-
new CodeMatch(OpCodes.Ldc_I4_5), new CodeMatch(OpCodes.Ldelem_I4));
410+
matcher.MatchForward(true, new CodeMatch(OpCodes.Ldc_I4, 6006));
413411

414412
object leaveLabel = matcher.Advance(1).Operand;
415413

416-
matcher.Start().MatchForward(false, new CodeMatch(OpCodes.Ldarg_0),
414+
matcher.Start().MatchForward(false,
415+
new CodeMatch(OpCodes.Ldfld, AccessTools.Field(typeof(LabComponent), nameof(LabComponent.nextLabId))),
416+
new CodeMatch(OpCodes.Ldelema),
417417
new CodeMatch(OpCodes.Ldfld, AccessTools.Field(typeof(LabComponent), nameof(LabComponent.needs))),
418418
new CodeMatch(OpCodes.Ldc_I4_0), new CodeMatch(OpCodes.Ldelem_I4));
419419

420-
matcher.InsertAndAdvance(new CodeInstruction(OpCodes.Ldarg_0), new CodeInstruction(OpCodes.Ldarg_1),
420+
matcher.InsertAndAdvance(
421421
new CodeInstruction(OpCodes.Call,
422422
AccessTools.Method(typeof(ResearchLabPatches), nameof(LabComponent_UpdateOutputToNext_Patch_Method))),
423423
new CodeInstruction(OpCodes.Br, leaveLabel));
424424

425+
matcher.SetInstructionAndAdvance(new CodeInstruction(OpCodes.Nop)).SetInstructionAndAdvance(new CodeInstruction(OpCodes.Nop))
426+
.SetInstructionAndAdvance(new CodeInstruction(OpCodes.Nop)).SetInstructionAndAdvance(new CodeInstruction(OpCodes.Nop))
427+
.SetInstructionAndAdvance(new CodeInstruction(OpCodes.Nop)).SetInstructionAndAdvance(new CodeInstruction(OpCodes.Nop))
428+
.SetInstructionAndAdvance(new CodeInstruction(OpCodes.Nop));
429+
425430
return matcher.InstructionEnumeration();
426431
}
427432

428-
public static void LabComponent_UpdateOutputToNext_Patch_Method(ref LabComponent labComponent, LabComponent[] labPool)
433+
public static void LabComponent_UpdateOutputToNext_Patch_Method(LabComponent[] labPool, ref LabComponent labComponent)
429434
{
430435
for (var i = 0; i < LabComponent.matrixIds.Length; i++)
431436
{
432-
if (labComponent.matrixServed[i] >= 3600 && labPool[labComponent.nextLabId].matrixServed[i] < 36000)
437+
ref LabComponent next = ref labPool[labComponent.nextLabId];
438+
439+
if (labComponent.matrixServed[i] >= 3600 && next.matrixServed[i] < 36000)
433440
{
441+
int p = (labComponent.matrixServed[0] - 7200) / 3600 * 3600;
442+
if (p > 36000) p = 36000;
434443
int num = labComponent.split_inc(ref labComponent.matrixServed[i], ref labComponent.matrixIncServed[i], 3600);
435-
labPool[labComponent.nextLabId].matrixIncServed[i] += num;
436-
labPool[labComponent.nextLabId].matrixServed[i] += 3600;
444+
next.matrixIncServed[i] += num;
445+
next.matrixServed[i] += p;
437446
}
438447
}
439448
}

src/ProjectGenesis.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public class ProjectGenesis : BaseUnityPlugin, IModCanSave, IMultiplayerMod
5454
{
5555
public const string MODGUID = "org.LoShin.GenesisBook";
5656
public const string MODNAME = "GenesisBook";
57-
public const string VERSION = "3.0.11";
57+
public const string VERSION = "3.0.12";
5858
public const string DEBUGVERSION = "";
5959

6060
public static bool LoadCompleted;

0 commit comments

Comments
 (0)