From 48869b45784663040222e8c9d1bd82c9b5b64397 Mon Sep 17 00:00:00 2001 From: amevarashi Date: Sat, 11 Jun 2022 14:23:28 +0500 Subject: [PATCH] Don't generate blood stain for corpses --- RJWSexperience/RJWSexperience/RJWUtility.cs | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/RJWSexperience/RJWSexperience/RJWUtility.cs b/RJWSexperience/RJWSexperience/RJWUtility.cs index f43d9d8..fd9381c 100644 --- a/RJWSexperience/RJWSexperience/RJWUtility.cs +++ b/RJWSexperience/RJWSexperience/RJWUtility.cs @@ -13,25 +13,24 @@ namespace RJWSexperience { public static bool RemoveVirginTrait(Pawn pawn, Pawn partner, SexProps props) { - int degree; Trait virgin = pawn.story?.traits?.GetTrait(VariousDefOf.Virgin); - if (virgin != null) + if (virgin == null) + return false; + + int degree = virgin.Degree; + if (pawn.gender == Gender.Female && degree > 0 && !pawn.Dead) { - degree = virgin.Degree; - if (pawn.gender == Gender.Female && degree > 0) - { - FilthMaker.TryMakeFilth(pawn.Position, pawn.Map, ThingDefOf.Filth_Blood, pawn.LabelShort, 1, FilthSourceFlags.Pawn); - } - ThrowVirginHIstoryEvent(pawn, partner, props, degree); - pawn.story.traits.RemoveTrait(virgin); - return true; + FilthMaker.TryMakeFilth(pawn.Position, pawn.Map, ThingDefOf.Filth_Blood, pawn.LabelShort, 1, FilthSourceFlags.Pawn); } - return false; + ThrowVirginHIstoryEvent(pawn, partner, props, degree); + pawn.story.traits.RemoveTrait(virgin); + return true; } /// /// For ideo patch /// + [System.Diagnostics.CodeAnalysis.SuppressMessage("Redundancy", "RCS1163:Unused parameter.", Justification = "All parameters are needed for the ideology patch")] public static void ThrowVirginHIstoryEvent(Pawn pawn, Pawn partner, SexProps props, int degree) { //for non-ideo