mirror of
https://gitgud.io/lutepickle/rjw_menstruation.git
synced 2024-08-14 22:46:52 +00:00
Move GetRacesPawnKind to Utility
This commit is contained in:
parent
76c2a67390
commit
697b837a4d
2 changed files with 11 additions and 14 deletions
|
@ -451,16 +451,6 @@ namespace RJW_Menstruation
|
|||
return baby;
|
||||
}
|
||||
|
||||
public PawnKindDef GetRacesPawnKind(Pawn pawn)
|
||||
{
|
||||
if (pawn == null) return null;
|
||||
if (pawn.kindDef?.race == pawn.def) return pawn.kindDef;
|
||||
return VariousDefOf.AllKinds.Find(kind => kind.race == pawn.def && kind.defName.Contains("Colonist")) ??
|
||||
VariousDefOf.AllKinds.Find(kind => kind.race == pawn.def) ??
|
||||
pawn.def.race?.AnyPawnKind ??
|
||||
pawn.kindDef;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Decide pawnkind from mother and father <para/>
|
||||
/// Come from RJW
|
||||
|
@ -470,8 +460,8 @@ namespace RJW_Menstruation
|
|||
/// <returns></returns>
|
||||
public PawnKindDef BabyPawnKindDecider(Pawn mother, Pawn father)
|
||||
{
|
||||
PawnKindDef motherKindDef = GetRacesPawnKind(mother);
|
||||
PawnKindDef fatherKindDef = GetRacesPawnKind(father);
|
||||
PawnKindDef motherKindDef = Utility.GetRacesPawnKind(mother);
|
||||
PawnKindDef fatherKindDef = Utility.GetRacesPawnKind(father);
|
||||
|
||||
PawnKindDef spawn_kind_def = motherKindDef;
|
||||
|
||||
|
|
|
@ -49,8 +49,15 @@ namespace RJW_Menstruation
|
|||
{
|
||||
public static System.Random random = new System.Random(Environment.TickCount);
|
||||
|
||||
|
||||
|
||||
public static PawnKindDef GetRacesPawnKind(Pawn pawn)
|
||||
{
|
||||
if (pawn == null) return null;
|
||||
if (pawn.kindDef?.race == pawn.def) return pawn.kindDef;
|
||||
return VariousDefOf.AllKinds.Find(kind => kind.race == pawn.def && kind.defName.Contains("Colonist")) ??
|
||||
VariousDefOf.AllKinds.Find(kind => kind.race == pawn.def) ??
|
||||
pawn.def.race?.AnyPawnKind ??
|
||||
pawn.kindDef;
|
||||
}
|
||||
|
||||
public static float GetCumVolume(this Pawn pawn)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue