small fix to avoid System.TypeLoadException when Licentia is not present

This commit is contained in:
Stardust3D 2024-05-27 20:54:13 +02:00
parent 06e09762a4
commit 086b2e155e
4 changed files with 36 additions and 12 deletions

View file

@ -7,7 +7,7 @@ namespace RJW_PlasticSurgeries
{
public abstract class Recipe_Plastic_Surgery : Recipe_Surgery
{
protected readonly bool HasDyspareunia = ModLister.HasActiveModWithName("Dyspareunia");
protected readonly bool HasDyspareunia = false; // ModLister.HasActiveModWithName("Dyspareunia");
protected readonly bool HasLicentia = ModLister.HasActiveModWithName("RimJobWorld - Licentia Labs");
public override IEnumerable<BodyPartRecord> GetPartsToApplyOn(Pawn pawn, RecipeDef recipe)

View file

@ -1,4 +1,5 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using LicentiaLabs;
using rjw;
using Verse;
@ -23,8 +24,15 @@ namespace RJW_PlasticSurgeries
return pawn.GetGenitalsList().FindAll(Genital_Helper.is_penis);
}
protected override (HediffDef, float) GetLicentiaDamage() =>
(Licentia.HediffDefs.StretchTear, 0.2f);
protected override (HediffDef, float) GetLicentiaDamage()
{
if (HasLicentia)
{
return (Licentia.HediffDefs.StretchTear, 0.2f);
}
throw new NotSupportedException();
}
}
public class Recipe_Surgery_Penoplasty_Micro : Recipe_Surgery_Penoplasty

View file

@ -1,4 +1,5 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using LicentiaLabs;
using rjw;
using Verse;
@ -21,9 +22,16 @@ namespace RJW_PlasticSurgeries
{
return pawn.GetAnusList();
}
protected override (HediffDef, float) GetLicentiaDamage() =>
(Licentia.HediffDefs.StretchTear, 0.2f);
protected override (HediffDef, float) GetLicentiaDamage()
{
if (HasLicentia)
{
return (Licentia.HediffDefs.StretchTear, 0.2f);
}
throw new NotSupportedException();
}
}
public class Recipe_Surgery_Sphinctoplasty_Micro : Recipe_Surgery_Sphinctoplasty

View file

@ -1,4 +1,5 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using LicentiaLabs;
using rjw;
using Verse;
@ -21,9 +22,16 @@ namespace RJW_PlasticSurgeries
{
return pawn.GetGenitalsList().FindAll(Genital_Helper.is_vagina);
}
protected override (HediffDef, float) GetLicentiaDamage() =>
(Licentia.HediffDefs.StretchTear, 0.2f);
protected override (HediffDef, float) GetLicentiaDamage()
{
if (HasLicentia)
{
return (Licentia.HediffDefs.StretchTear, 0.2f);
}
throw new NotSupportedException();
}
}
public class Recipe_Surgery_Vaginoplasty_Micro : Recipe_Surgery_Vaginoplasty