warvulture

This commit is contained in:
Ferdinando 2026-08-11 19:29:58 +02:00
commit 1c4b20bb06
13 changed files with 1671 additions and 142 deletions

View file

@ -338,6 +338,21 @@ namespace RacesOfValheim
HideItemInstances(__instance, "m_hairItemInstance");
HideItemInstances(__instance, "m_beardItemInstance");
SetHelmetVisible(__instance, false);
// Poses the mandible, once per frame, after the animation. Attached from
// here rather than from SkeletonRace because this postfix is the one path
// every skeleton reaches - local, remote and the menu preview - and the
// jaw is a rig bone, so whoever is looking sees the same face.
if (p.GetComponent<SkeletonJawFix>() == null)
{
p.gameObject.AddComponent<SkeletonJawFix>();
}
// The lights in the eye sockets, cloned out of this tier's own creature so
// that each one arrives its own colour. Outside the build block above on
// purpose: they hang off the player's rig bones rather than off the body
// container, so they outlive it and have to be checked every refresh.
SkeletonEyeGlow.Apply(__instance, rules.ModelPrefab);
}
}
else
@ -362,6 +377,10 @@ namespace RacesOfValheim
ShowItemInstances(__instance, "m_hairItemInstance");
ShowItemInstances(__instance, "m_beardItemInstance");
SetHelmetVisible(__instance, true);
// Parented to rig bones, not to the body container that was just switched
// off above - so without this a human keeps the skeleton's lit sockets.
SkeletonEyeGlow.Clear(__instance);
}
}
}
@ -514,7 +533,12 @@ namespace RacesOfValheim
}
}
private static Transform FindBoneByName(Transform[] bones, string skelBoneName)
/// <summary>
/// The player bone a creature's bone maps onto. Internal because the eye glow hangs
/// its clones off the same mapping the body is skinned through - one answer to
/// "which bone is this", not two that can drift apart.
/// </summary>
internal static Transform FindBoneByName(Transform[] bones, string skelBoneName)
{
// Exact match first
foreach (Transform b in bones)