diff --git a/CheatEnabler/CheatEnabler.cs b/CheatEnabler/CheatEnabler.cs index 94564d2..6b71b28 100644 --- a/CheatEnabler/CheatEnabler.cs +++ b/CheatEnabler/CheatEnabler.cs @@ -285,37 +285,37 @@ public class CheatEnabler : BaseUnityPlugin if (_fireIceOnBirthPlanet) { veins.Add(8); - settings.AddRange(new [] {1f, 1f, 0,5f, 1f}); + settings.AddRange(new [] {1f, 1f, 0.5f, 1f}); } if (_kimberliteOnBirthPlanet) { veins.Add(9); - settings.AddRange(new [] {1f, 1f, 0,5f, 1f}); + settings.AddRange(new [] {1f, 1f, 0.5f, 1f}); } if (_fractalOnBirthPlanet) { veins.Add(10); - settings.AddRange(new [] {1f, 1f, 0,5f, 1f}); + settings.AddRange(new [] {1f, 1f, 0.5f, 1f}); } if (_organicOnBirthPlanet) { veins.Add(11); - settings.AddRange(new [] {1f, 1f, 0,5f, 1f}); + settings.AddRange(new [] {1f, 1f, 0.5f, 1f}); } if (_opticalOnBirthPlanet) { veins.Add(12); - settings.AddRange(new [] {1f, 1f, 0,5f, 1f}); + settings.AddRange(new [] {1f, 1f, 0.5f, 1f}); } if (_spiniformOnBirthPlanet) { veins.Add(13); - settings.AddRange(new [] {1f, 1f, 0,5f, 1f}); + settings.AddRange(new [] {1f, 1f, 0.5f, 1f}); } if (_unipolarOnBirthPlanet) { veins.Add(14); - settings.AddRange(new [] {1f, 1f, 0,5f, 1f}); + settings.AddRange(new [] {1f, 1f, 0.5f, 1f}); } if (veins.Count > 0) { diff --git a/OverclockEverything/OverclockEverything.cs b/OverclockEverything/OverclockEverything.cs index 4922926..6cb01ea 100644 --- a/OverclockEverything/OverclockEverything.cs +++ b/OverclockEverything/OverclockEverything.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.Reflection.Emit; using BepInEx; using BepInEx.Configuration; @@ -73,6 +74,20 @@ public class Patch : BaseUnityPlugin Harmony.CreateAndPatchAll(typeof(BeltFix)); } + [HarmonyTranspiler, HarmonyPatch(typeof(BuildTool_Path), "CheckBuildConditions")] + private static IEnumerable BuildTool_Path_CheckBuildConditions_Transpiler( + IEnumerable instructions) + { + foreach (var instr in instructions) + { + if (instr.opcode == OpCodes.Ldc_R4 && instr.OperandIs(0.28f)) + { + instr.operand = 0.21f; + } + yield return instr; + } + } + [HarmonyTranspiler, HarmonyPatch(typeof(LabComponent), "SetFunction")] private static IEnumerable LabComponent_SetFunction_Transpiler(IEnumerable instructions) { @@ -135,6 +150,21 @@ public class Patch : BaseUnityPlugin } } + foreach (var proto in LDB.items.dataArray) + { + var prefabDesc = proto.prefabDesc; + FixExtValue(ref prefabDesc.buildCollider.ext.x); + FixExtValue(ref prefabDesc.buildCollider.ext.y); + FixExtValue(ref prefabDesc.buildCollider.ext.z); + if (prefabDesc.buildColliders == null) continue; + for (var i = 0; i < prefabDesc.buildColliders.Length; i++) + { + FixExtValue(ref prefabDesc.buildColliders[i].ext.x); + FixExtValue(ref prefabDesc.buildColliders[i].ext.y); + FixExtValue(ref prefabDesc.buildColliders[i].ext.z); + } + } + foreach (var proto in LDB.items.dataArray) { var prefabDesc = proto.prefabDesc; @@ -204,4 +234,14 @@ public class Patch : BaseUnityPlugin } } } + + private static void FixExtValue(ref float v) + { + if (v == 0f) + { + return; + } + var b = Math.Abs(v); + v = (v - b) * 0.75f + b; + } }