From d43eb0d4f92fb286a8ece8838b547d22c287168d Mon Sep 17 00:00:00 2001 From: Platinum Date: Sat, 18 Apr 2020 18:52:59 -0700 Subject: [PATCH] bugfix: null ref exceptions for masturbate, corpse todo: allow anims for masturbate and corpse? --- 1.1/Assemblies/Rimworld-Animations.dll | Bin 38400 -> 38912 bytes Source/Comps/CompBodyAnimator.cs | 1 + .../HarmonyPatch_DoLovinAnimationPatch.cs | 1 - ...HarmonyPatch_JobDriver_SexBaseInitiator.cs | 17 ++++++++++++++--- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/1.1/Assemblies/Rimworld-Animations.dll b/1.1/Assemblies/Rimworld-Animations.dll index 437fbbd17a3d960e330af0e3821d68ee60373704..748a7ab0bb1ece2584b28de6453dc98edde23927 100644 GIT binary patch delta 7639 zcmai33wRV&vaWOboq1&5nMr0s1`r5|ND!1PsF@H0K~SD5>njmh$&wX$sacTDL&1m& zakwa6l%U83-y!IlUA=<3uu<2$L40t11QcBsxoXr^QCzpGdV;v$z263>NFt?~DF1-{a2U33!m8!N8dS8!rVA>Bco@cTAD) znB67-f&hMyQ|4@oVj@vBOVf0e;M)h(>?Xijju&AGe>moy* z1jvHXGugguC6X*TWkEY0UFd(4;~!N0YH@akJI1+1S0P`Kv1@*63<~b@yNdJBBBv~S8np%@%-RVhj+8)MRcfg5&pMzMkE{7M!2r5H9j4lXKZ5}?jp?z zmcuNc&GM&K6^?zCv6(f~vfgp)@OA7huMYQ#GBpc!$Op{v@N5{s3sHBSZFymMsLs-1 zxGYn>(CH$1ym-s&g(3brD**QeV0kv-ncfFX9oj7_x=_-n zUL56xA7X?*O2Tc7Pq|5cDMDC@asa*wejm5JU?)~6UU*L3ujz2eq)KDh2`?=1u26JX zWsv50s4=R;8ceUlGK1v#S!YB7Ffa6d+zTUBig2Nu@W=Rm%?nckG>zjv8r#g1xywU| zcLoXf=yg^EYCUf#5gQZ>5Aa@)u+t=-MQbEZ!`v^y5Q$dD@Iy8(+`7%y=`?`EO9E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tT2Y+nphm2tv1Uj?l0GgllU{lCM6cTM{VMgwkouEw<<+=W{LpE7q3-vN*8J*#!0)w)nq}5v;(J_2 zWRBV!m)<7juYN_{q@2J`x4>+T#_}hVG-)Y{dR)0VbDox`M%)XuLUo2~fp$Uo6z;p!|$}H)5{uKE!mybt>IEo74*T3e@!Rt=5}VYqWcVev-q{ zbLtI!x7tDfL~lmd!+Koy_k6D(#3Shi)DJd=v0H7>{Kk(wuLsqY!93%*x(s?45nM`r zP<~zOfj%#x&vCWPOR@)}MP!rS!)Q~Vj}@c7UiL7i$sW<6h6xS}<{J_U;a($vucrB^ z+Kt#1f0x?m=!*Yqu@$i$e2Uls4kC7evxq$y`!Wt-{V@0m_2XD`Bja@NIlIE0_}gw* zxCaI~tL2CAlyg1fyYkNva37V5u=b}Y3K=>u4p3ZTm~T4b9$z(LzJER9a>aVld4V?E<8#zTzYWlzSbj1`RajJp^Q+4>antY<4ZB)RKmnnV{_ZJ zsWEMewnp2d?bH1FVtt9eRyU0a#*N0UiJ4=wrl0aXfLou9VGFU%y#z60EJdvMuR!dZ zN>-Ql1J{O2Y8CAsnV*nwj55$#vasb8=EQO_~d3fgU5{yCgZ zySCpxcNmBGm)qYoB$>FWq?Q8CMfdPg0bq|mv2=W=;40jK{(FdT67P0}h1+c)`YX>% zRS#4NB^%rtNVgji0#%-X;YqfaG8v8hf&`Jo(^c1qs}k>54L0&LrwCN#B|_C*@_T97 z!VJuC`h?7cOz>B1Qqfqd2Ln|_LVA*FVu?GeJL*GJ-Cs2#@lmqpysszp)!FS*Y0Zc TKKZjE?=NcfuR1O2t~LG#9V7y< diff --git a/Source/Comps/CompBodyAnimator.cs b/Source/Comps/CompBodyAnimator.cs index b355a4c..269eae2 100644 --- a/Source/Comps/CompBodyAnimator.cs +++ b/Source/Comps/CompBodyAnimator.cs @@ -119,6 +119,7 @@ namespace Rimworld_Animations { } public override void CompTick() { + base.CompTick(); if(Animating) { diff --git a/Source/Patches/rjwPatches/HarmonyPatch_DoLovinAnimationPatch.cs b/Source/Patches/rjwPatches/HarmonyPatch_DoLovinAnimationPatch.cs index 42f6ab2..c508266 100644 --- a/Source/Patches/rjwPatches/HarmonyPatch_DoLovinAnimationPatch.cs +++ b/Source/Patches/rjwPatches/HarmonyPatch_DoLovinAnimationPatch.cs @@ -21,7 +21,6 @@ namespace Rimworld_Animations { RestUtility.WakeUp(pawn); __result = JobMaker.MakeJob(DefDatabase.GetNamed("JoinInBedAnimation", true), partnerInMyBed, partnerInMyBed.CurrentBed()); } - } } } diff --git a/Source/Patches/rjwPatches/HarmonyPatch_JobDriver_SexBaseInitiator.cs b/Source/Patches/rjwPatches/HarmonyPatch_JobDriver_SexBaseInitiator.cs index a69e129..575915a 100644 --- a/Source/Patches/rjwPatches/HarmonyPatch_JobDriver_SexBaseInitiator.cs +++ b/Source/Patches/rjwPatches/HarmonyPatch_JobDriver_SexBaseInitiator.cs @@ -14,12 +14,19 @@ namespace Rimworld_Animations { static class HarmonyPatch_JobDriver_SexBaseInitiator_Start { public static void Postfix(ref JobDriver_SexBaseInitiator __instance) { + /* + These particular jobs need special code + don't play anim for now + */ + if(__instance is JobDriver_Masturbate_Bed || __instance is JobDriver_Masturbate_Quick || __instance is JobDriver_ViolateCorpse) { + return; + } + if(__instance is JobDriver_JoinInBed) { Log.Warning("Tried to start wrong JobDriver with Rimworld-Animations installed. If you see this warning soon after installing this mod, it's fine and animated sex will start soon. If you see this a long time after installing, that's a problem."); return; } - Pawn Target = __instance.Target as Pawn; Pawn pawn = __instance.pawn; Building_Bed bed = __instance.Bed; @@ -29,11 +36,15 @@ namespace Rimworld_Animations { else if (__instance is JobDriver_WhoreIsServingVisitors) { bed = (__instance as JobDriver_WhoreIsServingVisitors).Bed; } - else if(__instance is JobDriver_SexCasualForAnimation) { + else if (__instance is JobDriver_SexCasualForAnimation) { bed = (__instance as JobDriver_SexCasualForAnimation).Bed; } + else if (__instance is JobDriver_Masturbate_Bed) + bed = (__instance as JobDriver_Masturbate_Bed).Bed; - if ((__instance.Target as Pawn).jobs?.curDriver is JobDriver_SexBaseReciever) { + if ((__instance.Target as Pawn)?.jobs?.curDriver is JobDriver_SexBaseReciever) { + + Pawn Target = __instance.Target as Pawn; if (!(Target.jobs.curDriver as JobDriver_SexBaseReciever).parteners.Contains(pawn)) { (Target.jobs.curDriver as JobDriver_SexBaseReciever).parteners.Add(pawn);