jotunn 2.30 compatibility + minor bugs

This commit is contained in:
Ferdinando 2026-09-10 19:14:05 +02:00
commit ce671e7124
14 changed files with 107 additions and 49 deletions

View file

@ -414,7 +414,7 @@ namespace RacesOfValheim
Transform bone = FindBone(player, SvermConfigManagement.Bone);
if (bone == null)
{
WarnMissingSpineBone();
WarnMissingSpineBone(player);
return;
}
@ -496,7 +496,7 @@ namespace RacesOfValheim
/// Said once, not forty times a minute. The cosmetic pass runs on a timer, so an
/// unqualified LogWarning here would bury the log in the time it takes to read it.
/// </summary>
private static void WarnMissingSpineBone()
private static void WarnMissingSpineBone(Player player)
{
if (warnedMissingSpineBone) return;
warnedMissingSpineBone = true;
@ -505,8 +505,10 @@ namespace RacesOfValheim
// the rig simply has no Spine3 - it counts Spine, Spine1, Spine2 - and there was no
// way to know that from a warning that only said what was missing.
System.Text.StringBuilder spine = new System.Text.StringBuilder();
Player local = Player.m_localPlayer;
VisEquipment visEq = local != null ? local.GetComponent<VisEquipment>() : null;
// Read off the player being dressed, not Player.m_localPlayer. On the main menu the one
// being dressed is the character preview and m_localPlayer is still null, so the old read
// answered "none found" about a rig that has three spine bones.
VisEquipment visEq = player != null ? player.GetComponent<VisEquipment>() : null;
if (visEq != null && visEq.m_bodyModel != null && visEq.m_bodyModel.bones != null)
{
foreach (Transform b in visEq.m_bodyModel.bones)