1
0
mirror of https://github.com/soarqin/DSP_Mods.git synced 2025-12-10 12:43:27 +08:00
This commit is contained in:
2023-09-13 21:06:11 +08:00
parent d2ea2ad38c
commit 410e473de2
9 changed files with 408 additions and 156 deletions

View File

@@ -61,8 +61,7 @@ public static class BuildPatch
{
if (_noConditionPatch != null)
{
_noConditionPatch.UnpatchSelf();
_noConditionPatch = null;
return;
}
_noConditionPatch = Harmony.CreateAndPatchAll(typeof(NoConditionBuild));
@@ -128,8 +127,7 @@ public static class BuildPatch
{
if (_immediatePatch != null)
{
_immediatePatch.UnpatchSelf();
_immediatePatch = null;
return;
}
var factory = GameMain.mainPlayer?.factory;
@@ -178,8 +176,7 @@ public static class BuildPatch
{
if (_noCostPatch != null)
{
_noCostPatch.UnpatchSelf();
_noCostPatch = null;
return;
}
var factory = GameMain.mainPlayer?.factory;
@@ -223,6 +220,13 @@ public static class BuildPatch
}
if (itemId < 10000 && _canBuildItems[itemId]) __result = 100;
}
[HarmonyTranspiler]
[HarmonyPatch(typeof(PlayerAction_Inspect), nameof(PlayerAction_Inspect.GetObjectSelectDistance))]
private static IEnumerable<CodeInstruction> PlayerAction_Inspect_GetObjectSelectDistance_Transpiler(IEnumerable<CodeInstruction> instructions)
{
yield return new CodeInstruction(OpCodes.Ldc_R4, 10000f);
yield return new CodeInstruction(OpCodes.Ret);
}
private static void DoInit()
{