mirror of
https://gitgud.io/c0ffeeeeeeee/rimworld-animations.git
synced 2024-08-15 00:43:45 +00:00
offset changer + fix for pawns off map
This commit is contained in:
parent
c13b3d793b
commit
c915b10e54
11 changed files with 163 additions and 21 deletions
|
@ -40,9 +40,14 @@ namespace Rimworld_Animations {
|
|||
}
|
||||
|
||||
|
||||
if (bodyAnim != null && bodyAnim.isAnimating && !portrait) {
|
||||
if (bodyAnim != null && bodyAnim.isAnimating && !portrait && pawn.Map == Find.CurrentMap) {
|
||||
bodyAnim.tickGraphics(graphics);
|
||||
pawn.TryGetComp<CompBodyAnimator>().animatePawn(ref rootLoc, ref angle, ref bodyFacing, ref headFacing);
|
||||
bodyAnim.animatePawn(ref rootLoc, ref angle, ref bodyFacing, ref headFacing);
|
||||
|
||||
if(bodyAnim.CurrentAnimation?.actors[bodyAnim.ActorIndex]?.offsetsByDefName != null && bodyAnim.CurrentAnimation.actors[bodyAnim.ActorIndex].offsetsByDefName.ContainsKey(pawn.def.defName)) {
|
||||
rootLoc.x += bodyAnim.CurrentAnimation.actors[bodyAnim.ActorIndex].offsetsByDefName[pawn.def.defName].x;
|
||||
rootLoc.z += bodyAnim.CurrentAnimation.actors[bodyAnim.ActorIndex].offsetsByDefName[pawn.def.defName].y;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue