mirror of
https://gitgud.io/lutepickle/rjw_menstruation.git
synced 2024-08-14 22:46:52 +00:00
A bunch of type-safety around HAR.
This commit is contained in:
parent
2cb26ea016
commit
3132992aa3
4 changed files with 3 additions and 2 deletions
Binary file not shown.
Binary file not shown.
|
@ -1,4 +1,5 @@
|
|||
using AlienRace;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Verse;
|
||||
|
@ -11,7 +12,7 @@ namespace RJW_Menstruation
|
|||
public static bool IsHAR(this Pawn pawn)
|
||||
{
|
||||
if (!Configurations.HARActivated) return false;
|
||||
return pawn?.def is ThingDef_AlienRace;
|
||||
return GenTypes.GetTypeInAnyAssembly("AlienRace.ThingDef_AlienRace").IsInstanceOfType(pawn?.def);
|
||||
}
|
||||
|
||||
public static void CopyHARProperties(Pawn baby, Pawn original)
|
||||
|
|
|
@ -19,7 +19,7 @@ namespace RJW_Menstruation
|
|||
har.PatchAll(Assembly.GetExecutingAssembly());
|
||||
if (ModsConfig.IsActive("erdelf.HumanoidAlienRaces")) // Don't use the cached in Configurations, it isn't initialized yet
|
||||
{
|
||||
har.Patch(typeof(AlienRace.HarmonyPatches).GetMethod(nameof(AlienRace.HarmonyPatches.BirthOutcomeMultiplier)),
|
||||
har.Patch(GenTypes.GetTypeInAnyAssembly("AlienRace.HarmonyPatches").GetMethod(nameof(AlienRace.HarmonyPatches.BirthOutcomeMultiplier)),
|
||||
postfix: new HarmonyMethod(typeof(HAR_LitterSize_Undo).GetMethod(nameof(HAR_LitterSize_Undo.Postfix))));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue