- Fixed a bug that was causing alien addons to not render when pawns were wearing apparel
This commit is contained in:
AbstractConcept 2023-02-07 22:08:58 -06:00
parent 9144029fec
commit 001121649b
11 changed files with 20 additions and 13 deletions

View file

@ -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);

View file

@ -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)