mirror of
				https://gitgud.io/c0ffeeeeeeee/rimworld-animations.git
				synced 2024-08-15 00:43:45 +00:00 
			
		
		
		
	changed drawtracker to move with offset
This commit is contained in:
		
							parent
							
								
									c915b10e54
								
							
						
					
					
						commit
						2e18be1953
					
				
					 2 changed files with 9 additions and 2 deletions
				
			
		
										
											Binary file not shown.
										
									
								
							| 
						 | 
				
			
			@ -13,12 +13,19 @@ namespace Rimworld_Animations {
 | 
			
		|||
    public static class HarmonyPatch_Pawn_DrawTracker {
 | 
			
		||||
        public static bool Prefix(ref Pawn ___pawn, ref Vector3 __result) {
 | 
			
		||||
 | 
			
		||||
            if(___pawn.TryGetComp<CompBodyAnimator>() != null && ___pawn.TryGetComp<CompBodyAnimator>().isAnimating) {
 | 
			
		||||
            CompBodyAnimator bodyAnim = ___pawn.TryGetComp<CompBodyAnimator>();
 | 
			
		||||
 | 
			
		||||
            if (bodyAnim != null && bodyAnim.isAnimating) {
 | 
			
		||||
                __result = ___pawn.TryGetComp<CompBodyAnimator>().anchor + ___pawn.TryGetComp<CompBodyAnimator>().deltaPos;
 | 
			
		||||
 | 
			
		||||
                if (bodyAnim.CurrentAnimation?.actors[bodyAnim.ActorIndex]?.offsetsByDefName != null && bodyAnim.CurrentAnimation.actors[bodyAnim.ActorIndex].offsetsByDefName.ContainsKey(___pawn.def.defName)) {
 | 
			
		||||
                    __result.x += bodyAnim.CurrentAnimation.actors[bodyAnim.ActorIndex].offsetsByDefName[___pawn.def.defName].x;
 | 
			
		||||
                    __result.z += bodyAnim.CurrentAnimation.actors[bodyAnim.ActorIndex].offsetsByDefName[___pawn.def.defName].y;
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                return false;
 | 
			
		||||
            }
 | 
			
		||||
            return true;
 | 
			
		||||
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue