Null check for apparel tracker in DirtyEffect

This commit is contained in:
lutepickle 2024-02-22 15:33:02 -08:00
parent ff95b8da39
commit 32800a3499
2 changed files with 1 additions and 1 deletions

Binary file not shown.

View file

@ -272,7 +272,7 @@ namespace RJW_Menstruation
public override void DirtyEffect(int tickInterval) public override void DirtyEffect(int tickInterval)
{ {
if (wearTicks > MinHrstoDirtyEffect * GenDate.TicksPerHour && Rand.MTBEventOccurs(100.0f, GenDate.TicksPerHour, tickInterval) && !Wearer.apparel.IsLocked(this)) if (wearTicks > MinHrstoDirtyEffect * GenDate.TicksPerHour && Rand.MTBEventOccurs(100.0f, GenDate.TicksPerHour, tickInterval) && !(Wearer.apparel?.IsLocked(this) ?? false))
{ {
Wearer.health.AddHediff(HediffDefOf.WoundInfection, Genital_Helper.get_genitalsBPR(Wearer)); Wearer.health.AddHediff(HediffDefOf.WoundInfection, Genital_Helper.get_genitalsBPR(Wearer));
} }