Skip to content
Snippets Groups Projects
Commit e7013e86 authored by a flock of birds's avatar a flock of birds
Browse files

Fixed error spam when displaying a child's work tab entry without biotech installed

parent e3b926d3
No related branches found
No related tags found
No related merge requests found
......@@ -6,6 +6,7 @@ using System.Reflection.Emit;
using HarmonyLib;
using Verse;
using RimWorld;
using UnityEngine;
// Non-pregnancy Biotech-related patches
namespace rjw
......@@ -20,7 +21,8 @@ namespace rjw
yield return AccessTools.Method(typeof(LifeStageWorker_HumanlikeAdult), lifeStageStarted);
}
// Fixes an error caused by trying to spawn a biotech-only effector when a child starts a new lifestage
// Fixes errors caused by trying to spawn a biotech-only effector when a child starts a new lifestage
// and by trying to send a biotech-only letter when a child turns three
[HarmonyTranspiler]
static IEnumerable<CodeInstruction> FixLifeStageStartError(IEnumerable<CodeInstruction> instructions, MethodBase original)
{
......@@ -48,4 +50,20 @@ namespace rjw
}
}
}
[HarmonyPatch(typeof(WidgetsWork), "get_WorkBoxBGTex_AgeDisabled")]
class WidgetsWork_WorkBoxBGTex_AgeDisabled
{
[HarmonyPrefix]
static bool DontLoadMissingTexture(ref Texture2D __result)
{
if (!ModsConfig.BiotechActive)
{
__result = WidgetsWork.WorkBoxBGTex_Awful;
return false;
}
return true;
}
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment