mirror of
				https://gitgud.io/AbstractConcept/rimworld-animations-patch.git
				synced 2024-08-15 00:43:27 +00:00 
			
		
		
		
	v2.0.3
- Fixed a bug that was causing alien addons to not render when pawns were wearing apparel
This commit is contained in:
		
							parent
							
								
									9144029fec
								
							
						
					
					
						commit
						001121649b
					
				
					 11 changed files with 20 additions and 13 deletions
				
			
		| 
						 | 
				
			
			@ -22,8 +22,8 @@ namespace Rimworld_Animations_Patch
 | 
			
		|||
				{
 | 
			
		||||
					if (LoadedModManager.RunningModsListForReading.Any(x => x.PackageIdPlayerFacing == "babies.and.children.continued.13"))
 | 
			
		||||
					{
 | 
			
		||||
						(new Harmony("Rimworld_Animations_Patch")).Patch(AccessTools.Method(typeof(AnimationPatchUtility), "ShouldNotDrawAddonsForPawn"),
 | 
			
		||||
							prefix: new HarmonyMethod(AccessTools.Method(typeof(HarmonyPatch_BabiesAndChildren), "Prefix_ShouldNotDrawAddonsForPawn")));
 | 
			
		||||
						(new Harmony("Rimworld_Animations_Patch")).Patch(AccessTools.Method(typeof(AnimationPatchUtility), "ShouldNotAnimatePawn"),
 | 
			
		||||
							prefix: new HarmonyMethod(AccessTools.Method(typeof(HarmonyPatch_BabiesAndChildren), "Prefix_ShouldNotAnimatePawn")));
 | 
			
		||||
						(new Harmony("Rimworld_Animations_Patch")).Patch(AccessTools.Method(typeof(AnimationPatchUtility), "GetBodySize"),
 | 
			
		||||
							prefix: new HarmonyMethod(AccessTools.Method(typeof(HarmonyPatch_BabiesAndChildren), "Prefix_GetBodySize")));
 | 
			
		||||
					}
 | 
			
		||||
| 
						 | 
				
			
			@ -33,7 +33,7 @@ namespace Rimworld_Animations_Patch
 | 
			
		|||
			catch (TypeLoadException) {  }
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		public static bool Prefix_ShouldNotDrawAddonsForPawn(ref bool __result, Pawn pawn)
 | 
			
		||||
		public static bool ShouldNotAnimatePawn(ref bool __result, Pawn pawn)
 | 
			
		||||
		{		
 | 
			
		||||
			__result = AgeStages.IsYoungerThan(pawn, AgeStages.Child, false);			
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -121,7 +121,7 @@ namespace Rimworld_Animations_Patch
 | 
			
		|||
			{ ApparelAnimationUtility.TryToDrawApparelOnFloor(pawn); }
 | 
			
		||||
 | 
			
		||||
			// Exit clauses
 | 
			
		||||
			if (BasicSettings.useLegacyAnimationSystem || AnimationPatchUtility.ShouldNotDrawAddonsForPawn(pawn) || sexDataComp == null)
 | 
			
		||||
			if (BasicSettings.useLegacyAnimationSystem || AnimationPatchUtility.ShouldNotAnimatePawn(pawn) || sexDataComp == null)
 | 
			
		||||
			{ return true; }
 | 
			
		||||
 | 
			
		||||
			// Get available hands
 | 
			
		||||
| 
						 | 
				
			
			@ -141,7 +141,7 @@ namespace Rimworld_Animations_Patch
 | 
			
		|||
				if (bodyAddonDatum == null) continue;
 | 
			
		||||
 | 
			
		||||
				// Can draw?
 | 
			
		||||
				bool canDraw = addonGraphic.path.Contains("featureless") == false && addonGraphic.path.Contains("Featureless") == false && bodyAddonDatum.CanDraw();
 | 
			
		||||
				bool canDraw = addonGraphic.path.Contains("featureless", StringComparison.OrdinalIgnoreCase) == false && bodyAddonDatum.CanDraw();
 | 
			
		||||
				bool drawHand = BasicSettings.showHands && handsAvailableCount > 0 && renderFlags.FlagSet(PawnRenderFlags.Portrait) == false;
 | 
			
		||||
 | 
			
		||||
				if (canDraw == false && drawHand == false)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue