Skip to content

Commit

Permalink
Update 3.0.12
Browse files Browse the repository at this point in the history
  • Loading branch information
Awbugl committed Nov 30, 2024
1 parent 94aa304 commit 1c98782
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 15 deletions.
12 changes: 9 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
- v3.0.11
+ 修复了v3.0.9的上传速度调整导致的研究站工作不正常的问题
- v3.0.12
+ 粗略适配版本V0.10.31.24646

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


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


- v3.0.11
+ 修复了v3.0.9的上传速度调整导致的研究站工作不正常的问题

+ Fixed issue that research lab work improperly due to upload speed adjustments in v3.0.9


- v3.0.10
+ 调整了星球矿脉分布,增加了出生点的矿物类型和数量(仅对新存档生效)
+ 调整了部分物品的位置
Expand Down
1 change: 0 additions & 1 deletion src/Patches/UI/BeltColorFix/BeltFixPatches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ public static IEnumerable<CodeInstruction> CargoTraffic_SetBeltSelected_Transpil
return matcher.InstructionEnumeration();
}

[HarmonyPatch(typeof(BuildTool_BlueprintPaste), nameof(BuildTool_BlueprintPaste.UpdatePreviewModels))]
[HarmonyPatch(typeof(BuildTool_BlueprintCopy), nameof(BuildTool_BlueprintCopy.UpdatePreviewModels))]
[HarmonyPatch(typeof(BuildTool_Path), nameof(BuildTool_Path.UpdateGizmos))]
[HarmonyTranspiler]
Expand Down
2 changes: 1 addition & 1 deletion src/Patches/UI/FactoryModelPatches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public static class FactoryModelPatches
{
private static Material atmosphericCollectStationMaterial;

[HarmonyPatch(typeof(FactoryModel), nameof(FactoryModel.InitCollectorMaterial))]
[HarmonyPatch(typeof(FactoryModel), nameof(FactoryModel.InitMaterial))]
[HarmonyPostfix]
public static void FactoryModel_InitCollectorMaterial(FactoryModel __instance)
{
Expand Down
27 changes: 18 additions & 9 deletions src/Patches/UI/ResearchLabPatches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -407,33 +407,42 @@ public static IEnumerable<CodeInstruction> LabComponent_UpdateOutputToNext_Trans
{
var matcher = new CodeMatcher(instructions);

matcher.MatchForward(true, new CodeMatch(OpCodes.Ldarg_0),
new CodeMatch(OpCodes.Ldfld, AccessTools.Field(typeof(LabComponent), nameof(LabComponent.needs))),
new CodeMatch(OpCodes.Ldc_I4_5), new CodeMatch(OpCodes.Ldelem_I4));
matcher.MatchForward(true, new CodeMatch(OpCodes.Ldc_I4, 6006));

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

matcher.Start().MatchForward(false, new CodeMatch(OpCodes.Ldarg_0),
matcher.Start().MatchForward(false,
new CodeMatch(OpCodes.Ldfld, AccessTools.Field(typeof(LabComponent), nameof(LabComponent.nextLabId))),
new CodeMatch(OpCodes.Ldelema),
new CodeMatch(OpCodes.Ldfld, AccessTools.Field(typeof(LabComponent), nameof(LabComponent.needs))),
new CodeMatch(OpCodes.Ldc_I4_0), new CodeMatch(OpCodes.Ldelem_I4));

matcher.InsertAndAdvance(new CodeInstruction(OpCodes.Ldarg_0), new CodeInstruction(OpCodes.Ldarg_1),
matcher.InsertAndAdvance(
new CodeInstruction(OpCodes.Call,
AccessTools.Method(typeof(ResearchLabPatches), nameof(LabComponent_UpdateOutputToNext_Patch_Method))),
new CodeInstruction(OpCodes.Br, leaveLabel));

matcher.SetInstructionAndAdvance(new CodeInstruction(OpCodes.Nop)).SetInstructionAndAdvance(new CodeInstruction(OpCodes.Nop))
.SetInstructionAndAdvance(new CodeInstruction(OpCodes.Nop)).SetInstructionAndAdvance(new CodeInstruction(OpCodes.Nop))
.SetInstructionAndAdvance(new CodeInstruction(OpCodes.Nop)).SetInstructionAndAdvance(new CodeInstruction(OpCodes.Nop))
.SetInstructionAndAdvance(new CodeInstruction(OpCodes.Nop));

return matcher.InstructionEnumeration();
}

public static void LabComponent_UpdateOutputToNext_Patch_Method(ref LabComponent labComponent, LabComponent[] labPool)
public static void LabComponent_UpdateOutputToNext_Patch_Method(LabComponent[] labPool, ref LabComponent labComponent)
{
for (var i = 0; i < LabComponent.matrixIds.Length; i++)
{
if (labComponent.matrixServed[i] >= 3600 && labPool[labComponent.nextLabId].matrixServed[i] < 36000)
ref LabComponent next = ref labPool[labComponent.nextLabId];

if (labComponent.matrixServed[i] >= 3600 && next.matrixServed[i] < 36000)
{
int p = (labComponent.matrixServed[0] - 7200) / 3600 * 3600;
if (p > 36000) p = 36000;
int num = labComponent.split_inc(ref labComponent.matrixServed[i], ref labComponent.matrixIncServed[i], 3600);
labPool[labComponent.nextLabId].matrixIncServed[i] += num;
labPool[labComponent.nextLabId].matrixServed[i] += 3600;
next.matrixIncServed[i] += num;
next.matrixServed[i] += p;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/ProjectGenesis.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public class ProjectGenesis : BaseUnityPlugin, IModCanSave, IMultiplayerMod
{
public const string MODGUID = "org.LoShin.GenesisBook";
public const string MODNAME = "GenesisBook";
public const string VERSION = "3.0.11";
public const string VERSION = "3.0.12";
public const string DEBUGVERSION = "";

public static bool LoadCompleted;
Expand Down

0 comments on commit 1c98782

Please sign in to comment.