Re-add GetMenstruationComp(Hediff) marked as obsolete. There's code out there that calls it.

This commit is contained in:
lutepickle 2023-01-07 06:08:42 -08:00
parent 68f05dc272
commit b4aa55c159
2 changed files with 23 additions and 0 deletions

Binary file not shown.

View File

@ -73,6 +73,29 @@ namespace RJW_Menstruation
return null;
}
[Obsolete("This method is obsolete and can cause ambiguity. Use GetMenstruationCompFromVagina or GetMenstruationCompFromPregnancy instead.", true)]
public static HediffComp_Menstruation GetMenstruationComp(Hediff hediff)
{
switch (hediff)
{
case Hediff_BasePregnancy rjwPreg:
return rjwPreg.GetMenstruationCompFromPregnancy();
case Hediff_Pregnant vanillaPreg:
return vanillaPreg.GetMenstruationCompFromPregnancy();
case Hediff_Labor vanillaLabor:
return vanillaLabor.GetMenstruationCompFromPregnancy();
case Hediff_LaborPushing vanillaLaborPushing:
return vanillaLaborPushing.GetMenstruationCompFromPregnancy();
case Hediff_PartBaseNatural rjwNatrual:
return rjwNatrual.GetMenstruationCompFromVagina();
case Hediff_PartBaseArtifical rjwArtificial:
return rjwArtificial.GetMenstruationCompFromVagina();
default:
Log.Warning("Obsolete GetMenstruationComp called with unknown hediff. Ensure your submods are up to date.");
return null;
}
}
public static HediffComp_Anus GetAnusComp(this Hediff hediff)
{
if (hediff is Hediff_PartBaseNatural || hediff is Hediff_PartBaseArtifical)