HAR gained a builtin property copier, so use that instead

This commit is contained in:
lutepickle 2024-05-29 20:39:35 -07:00
parent 2dd86964d4
commit 4a41bb69f4
2 changed files with 3 additions and 13 deletions

View file

@ -16,19 +16,8 @@ namespace RJW_Menstruation
public static void CopyHARProperties(Pawn baby, Pawn original)
{
AlienPartGenerator.AlienComp babyHARComp = baby?.TryGetComp<AlienPartGenerator.AlienComp>();
AlienPartGenerator.AlienComp originalHARComp = original?.TryGetComp<AlienPartGenerator.AlienComp>();
if (babyHARComp == null || originalHARComp == null) return;
babyHARComp.addonVariants = new List<int>(originalHARComp.addonVariants);
foreach (KeyValuePair<string, AlienPartGenerator.ExposableValueTuple<Color, Color>> channel in originalHARComp.ColorChannels)
{
babyHARComp.OverwriteColorChannel(channel.Key, channel.Value.first, channel.Value.second);
}
babyHARComp.headVariant = originalHARComp.headVariant;
babyHARComp.bodyVariant = originalHARComp.bodyVariant;
babyHARComp.headMaskVariant = originalHARComp.headMaskVariant;
babyHARComp.bodyMaskVariant = originalHARComp.bodyMaskVariant;
if (!baby.HasComp<AlienPartGenerator.AlienComp>() || !original.HasComp<AlienPartGenerator.AlienComp>()) return;
AlienPartGenerator.AlienComp.CopyAlienData(original, baby);
}
}
}

View file

@ -457,6 +457,7 @@ namespace RJW_Menstruation
return Color.white;
}
}
public static ThingDef BloodDef(Pawn pawn)
{
if (pawn == null) return ThingDefOf.Filth_Blood;