Do a bit of housekeeping when an absorber goes dirty

This commit is contained in:
lutepickle 2024-01-01 19:59:40 -08:00
parent f410f6bc0f
commit 40b23fc9c9
1 changed files with 4 additions and 1 deletions

View File

@ -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();
}
}