From 40b23fc9c9f5d489adb6ffa96821606dace90b0b Mon Sep 17 00:00:00 2001 From: lutepickle <28810-lutepickle@users.noreply.gitgud.io> Date: Mon, 1 Jan 2024 19:59:40 -0800 Subject: [PATCH] Do a bit of housekeeping when an absorber goes dirty --- 1.4/source/RJW_Menstruation/RJW_Menstruation/Things.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/1.4/source/RJW_Menstruation/RJW_Menstruation/Things.cs b/1.4/source/RJW_Menstruation/RJW_Menstruation/Things.cs index c046746..6417fb4 100644 --- a/1.4/source/RJW_Menstruation/RJW_Menstruation/Things.cs +++ b/1.4/source/RJW_Menstruation/RJW_Menstruation/Things.cs @@ -219,13 +219,16 @@ namespace RJW_Menstruation public void CheckDirty() { - if (absorbedfluids > this.GetStatValue(VariousDefOf.MaxAbsorbable) && (Wearer?.apparel.IsLocked(this) ?? false)) + if (absorbedfluids > this.GetStatValue(VariousDefOf.MaxAbsorbable) && (Wearer?.apparel?.IsLocked(this) ?? false)) { def = DirtyDef; dirty = true; OutfitForcedHandler forcedHandler = Wearer.outfits?.forcedHandler; if (forcedHandler?.IsForced(this) ?? false) forcedHandler.SetForced(this, false); + if (!def.equippedStatOffsets.NullOrEmpty()) + Wearer.health.capacities.Notify_CapacityLevelsDirty(); + Wearer.apparel.Notify_ApparelChanged(); } }