mirror of
https://gitgud.io/c0ffeeeeeeee/rimworld-animations.git
synced 2024-08-15 00:43:45 +00:00
extra null ref checks and tweaks
This commit is contained in:
parent
e006e54020
commit
8ed4ebb5c2
5 changed files with 18 additions and 9 deletions
|
@ -154,7 +154,7 @@ namespace Rimworld_Animations {
|
|||
base.CompTick();
|
||||
|
||||
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;
|
||||
}
|
||||
else {
|
||||
|
@ -310,6 +310,9 @@ namespace Rimworld_Animations {
|
|||
Scribe_Values.Look(ref bodyAngle, "bodyAngle");
|
||||
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, "bodyFacing");
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
||||
Pawn pawn2 = target as Pawn;
|
||||
|
||||
if (pawn == null || pawn2 == null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
if (pawn.IsHashIntervalTick(__instance.ticks_between_thrusts)) {
|
||||
|
||||
__instance.Animate(pawn, pawn2);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue