diff --git a/1.1/Assemblies/WhatTheHack.dll b/1.1/Assemblies/WhatTheHack.dll index 42a1916c..7bed3643 100644 Binary files a/1.1/Assemblies/WhatTheHack.dll and b/1.1/Assemblies/WhatTheHack.dll differ diff --git a/1.1/Source/WhatTheHack/Harmony/HealthCardUtility.cs b/1.1/Source/WhatTheHack/Harmony/HealthCardUtility.cs index dc88d657..ad55d006 100644 --- a/1.1/Source/WhatTheHack/Harmony/HealthCardUtility.cs +++ b/1.1/Source/WhatTheHack/Harmony/HealthCardUtility.cs @@ -15,16 +15,13 @@ class HealthCardUtility_GenerateSurgeryOption { static bool Prefix(Pawn pawn, RecipeDef recipe, BodyPartRecord part, ref FloatMenuOption __result) { - Log.Message("generateSurgeryOption called for: " + recipe.defName); if(recipe.Worker is Recipe_Hacking worker) { if (!worker.CanApplyOn(pawn, out string reason)){ if(reason == "") { - Log.Message("no reason for: " + recipe.defName); return false; } - Log.Message("generating option for: " + recipe.defName); string text = recipe.Worker.GetLabelWhenUsedOn(pawn, part).CapitalizeFirst(); if (part != null && !recipe.hideBodyPartNames) { @@ -37,12 +34,7 @@ static bool Prefix(Pawn pawn, RecipeDef recipe, BodyPartRecord part, ref FloatMe __result = floatMenuOption; return false; } - else - { - Log.Message("cannot apply: " + recipe.defName); - } } - Log.Message("GenerateSurgeryOption failed for: " + recipe.defName); return true; } } diff --git a/1.1/Source/WhatTheHack/Harmony/StatWorker.cs b/1.1/Source/WhatTheHack/Harmony/StatWorker.cs index e517dc6e..e626330a 100644 --- a/1.1/Source/WhatTheHack/Harmony/StatWorker.cs +++ b/1.1/Source/WhatTheHack/Harmony/StatWorker.cs @@ -45,7 +45,7 @@ static IEnumerable Transpiler(IEnumerable inst var instructionsList = new List(instructions); foreach (CodeInstruction instruction in instructionsList) { - if (instruction.operand as MethodInfo == typeof(Pawn).GetField("skills")) + if (instruction.operand as MethodInfo == AccessTools.Field(typeof(Pawn), "skills")) { yield return new CodeInstruction(OpCodes.Ldarg_0); yield return new CodeInstruction(OpCodes.Ldfld, AccessTools.Field(typeof(StatWorker), "stat")); diff --git a/1.1/Source/WhatTheHack/Jobs/WorkGiver_PerformMaintenance.cs b/1.1/Source/WhatTheHack/Jobs/WorkGiver_PerformMaintenance.cs index 1691e6db..662f1d8c 100644 --- a/1.1/Source/WhatTheHack/Jobs/WorkGiver_PerformMaintenance.cs +++ b/1.1/Source/WhatTheHack/Jobs/WorkGiver_PerformMaintenance.cs @@ -24,11 +24,12 @@ public override bool ShouldSkip(Pawn pawn, bool forced = false) return false; } - private static bool PawnNeedsMaintenance(Pawn mech) + private bool PawnNeedsMaintenance(Pawn mech) { - if (mech.needs != null && mech.needs.TryGetNeed(WTH_DefOf.WTH_Mechanoid_Maintenance) is Need_Maintenance need && need.CurLevel < need.maintenanceThreshold) - { - return true; + if (mech.needs != null && mech.needs.TryGetNeed(WTH_DefOf.WTH_Mechanoid_Maintenance) is Need_Maintenance need){ + if(need.CurLevel < GetThresHold(need)){ + return true; + } } return false; } diff --git a/About/Version.xml b/About/Version.xml index 42d0395f..fdf34ee0 100644 --- a/About/Version.xml +++ b/About/Version.xml @@ -4,7 +4,7 @@ but no minimum version will be required --> - 2.1.1 + 2.1.2 5.0.0