mirror of
https://github.com/vegapnk/RJW-Genes.git
synced 2024-08-15 00:23:31 +00:00
Prevented GenitaliaChanger from creating redundant parts and refactored to allow changing single parts
This commit is contained in:
parent
a5c8843faf
commit
a128dbac01
2 changed files with 4 additions and 4 deletions
Binary file not shown.
|
@ -16,7 +16,7 @@ namespace RJW_Genes
|
|||
/// <param name="penisReplacement">the new type of penis</param>
|
||||
/// <param name="vaginaReplacement">the new type of vagina</param>
|
||||
/// <param name="anusReplacement">the new type of anus</param>
|
||||
public static void ChangeGenitalia(Pawn pawn, HediffDef penisReplacement, HediffDef vaginaReplacement, HediffDef anusReplacement)
|
||||
public static void ChangeGenitalia(Pawn pawn, HediffDef penisReplacement = null, HediffDef vaginaReplacement = null, HediffDef anusReplacement = null)
|
||||
{
|
||||
var oldParts = Genital_Helper.get_AllPartsHediffList(pawn);
|
||||
BodyPartRecord correctBPR;
|
||||
|
@ -34,13 +34,13 @@ namespace RJW_Genes
|
|||
|
||||
replacementGenital = null;
|
||||
CompHediff = null;
|
||||
if (Genital_Helper.is_penis(existingGenital))
|
||||
if (Genital_Helper.is_penis(existingGenital) && penisReplacement != null && existingGenital.def != penisReplacement)
|
||||
replacementGenital = HediffMaker.MakeHediff(penisReplacement, pawn, correctBPR);
|
||||
|
||||
if (Genital_Helper.is_vagina(existingGenital))
|
||||
if (Genital_Helper.is_vagina(existingGenital) && vaginaReplacement != null && existingGenital.def != vaginaReplacement)
|
||||
replacementGenital = HediffMaker.MakeHediff(vaginaReplacement, pawn, correctBPR);
|
||||
|
||||
if (IsAnus(existingGenital))
|
||||
if (IsAnus(existingGenital) && anusReplacement != null && existingGenital.def != anusReplacement)
|
||||
{
|
||||
correctBPR = Genital_Helper.get_anusBPR(pawn);
|
||||
replacementGenital = HediffMaker.MakeHediff(anusReplacement, pawn, correctBPR);
|
||||
|
|
Loading…
Reference in a new issue