extra null ref checks and tweaks

This commit is contained in:
Platinum 2020-05-29 13:12:35 -07:00
parent e006e54020
commit 8ed4ebb5c2
5 changed files with 18 additions and 9 deletions

View file

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<Defs> <Defs>
<Rimworld_Animations.AnimationDef> <Rimworld_Animations.AnimationDef>
<defName>Quadruped_Doggystyle</defName> <defName>Dog_Doggystyle</defName>
<label>quadruped doggystyle</label> <label>dog doggystyle</label>
<sounds>true</sounds> <sounds>true</sounds>
<sexTypes> <sexTypes>
<li>Anal</li> <li>Anal</li>

View file

@ -632,7 +632,7 @@
<bodyFacing>2</bodyFacing> <bodyFacing>2</bodyFacing>
<headFacing>2</headFacing> <headFacing>2</headFacing>
<headBob>0</headBob> <headBob>0</headBob>
<genitalAngle>90</genitalAngle> <genitalAngle>180</genitalAngle>
</li> </li>
<li> <li>
<tickDuration>59</tickDuration> <tickDuration>59</tickDuration>
@ -652,7 +652,7 @@
<bodyFacing>2</bodyFacing> <bodyFacing>2</bodyFacing>
<headFacing>2</headFacing> <headFacing>2</headFacing>
<headBob>0</headBob> <headBob>0</headBob>
<genitalAngle>90</genitalAngle> <genitalAngle>180</genitalAngle>
</li> </li>
</keyframes> </keyframes>
</li> </li>
@ -710,7 +710,7 @@
<bodyFacing>2</bodyFacing> <bodyFacing>2</bodyFacing>
<headFacing>2</headFacing> <headFacing>2</headFacing>
<headBob>0</headBob> <headBob>0</headBob>
<genitalAngle>90</genitalAngle> <genitalAngle>180</genitalAngle>
</li> </li>
<li> <li>
<tickDuration>14</tickDuration> <tickDuration>14</tickDuration>
@ -730,7 +730,7 @@
<bodyFacing>2</bodyFacing> <bodyFacing>2</bodyFacing>
<headFacing>2</headFacing> <headFacing>2</headFacing>
<headBob>0</headBob> <headBob>0</headBob>
<genitalAngle>90</genitalAngle> <genitalAngle>180</genitalAngle>
</li> </li>
</keyframes> </keyframes>
</li> </li>
@ -815,7 +815,7 @@
<bodyFacing>2</bodyFacing> <bodyFacing>2</bodyFacing>
<headFacing>2</headFacing> <headFacing>2</headFacing>
<headBob>0</headBob> <headBob>0</headBob>
<genitalAngle>90</genitalAngle> <genitalAngle>180</genitalAngle>
</li> </li>
<li> <li>
<tickDuration>7</tickDuration> <tickDuration>7</tickDuration>
@ -864,7 +864,7 @@
<bodyFacing>2</bodyFacing> <bodyFacing>2</bodyFacing>
<headFacing>2</headFacing> <headFacing>2</headFacing>
<headBob>0</headBob> <headBob>0</headBob>
<genitalAngle>90</genitalAngle> <genitalAngle>180</genitalAngle>
</li> </li>
</keyframes> </keyframes>
</li> </li>

View file

@ -154,7 +154,7 @@ namespace Rimworld_Animations {
base.CompTick(); base.CompTick();
if(isAnimating) { if(isAnimating) {
if (pawn?.jobs?.curDriver == null || (pawn?.jobs?.curDriver != null && !(pawn?.jobs?.curDriver is rjw.JobDriver_Sex))) { if (pawn.Dead || pawn?.jobs?.curDriver == null || (pawn?.jobs?.curDriver != null && !(pawn?.jobs?.curDriver is rjw.JobDriver_Sex))) {
isAnimating = false; isAnimating = false;
} }
else { else {
@ -310,6 +310,9 @@ namespace Rimworld_Animations {
Scribe_Values.Look(ref bodyAngle, "bodyAngle"); Scribe_Values.Look(ref bodyAngle, "bodyAngle");
Scribe_Values.Look(ref headAngle, "headAngle"); Scribe_Values.Look(ref headAngle, "headAngle");
Scribe_Values.Look(ref genitalAngle, "GenitalAngle");
Scribe_Values.Look(ref controlGenitalAngle, "controlGenitalAngle");
Scribe_Values.Look(ref headFacing, "headFacing"); Scribe_Values.Look(ref headFacing, "headFacing");
Scribe_Values.Look(ref headFacing, "bodyFacing"); Scribe_Values.Look(ref headFacing, "bodyFacing");

View file

@ -17,6 +17,12 @@ namespace Rimworld_Animations {
public static bool Prefix(ref JobDriver_Sex __instance, ref Pawn pawn, ref Thing target, ref bool pawnnude, ref bool partnernude) { public static bool Prefix(ref JobDriver_Sex __instance, ref Pawn pawn, ref Thing target, ref bool pawnnude, ref bool partnernude) {
Pawn pawn2 = target as Pawn; Pawn pawn2 = target as Pawn;
if (pawn == null || pawn2 == null) {
return true;
}
if (pawn.IsHashIntervalTick(__instance.ticks_between_thrusts)) { if (pawn.IsHashIntervalTick(__instance.ticks_between_thrusts)) {
__instance.Animate(pawn, pawn2); __instance.Animate(pawn, pawn2);