feat(skeleton): wear Skeleton_Hildir from Moder, not the charred twitcher
Swaps the model the race takes at Moder. Hildir'''s skeleton is built on the same rig as the plain one, so the 0.85/1.20/0.85 squeeze goes with it - that existed only to make the charred twitcher'''s broader, shorter proportions read as a player, and the bone-by-name remapping the swap relies on now has an exact rig to match against rather than an approximate one. The compendium no longer claims the bones blacken, since they no longer do; the fire aura it describes is unchanged. An unresolved model id used to fail silently and invisibly - the human body is switched off before the replacement is built, so a bad name leaves a player with no mesh at all. It now warns once per name.
This commit is contained in:
parent
5ef7a102da
commit
f192f929f6
3 changed files with 31 additions and 10 deletions
|
|
@ -10,6 +10,20 @@ namespace RacesOfValheim
|
|||
private static Mesh skeletonMesh = null;
|
||||
private static Material[] skeletonMaterials = null;
|
||||
|
||||
// Model names already reported as missing. The body swap runs from a visual refresh, so
|
||||
// without this a mistyped prefab id would log every time equipment changes.
|
||||
private static readonly System.Collections.Generic.HashSet<string> warnedMissingModels =
|
||||
new System.Collections.Generic.HashSet<string>();
|
||||
|
||||
private static void WarnMissingModelOnce(string prefabName)
|
||||
{
|
||||
if (!warnedMissingModels.Add(prefabName)) return;
|
||||
|
||||
Jotunn.Logger.LogWarning(
|
||||
$"[Skeleton] Body model prefab '{prefabName}' not found - the race has no mesh at this tier. " +
|
||||
"Check the id in SkeletonProgression.");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Makes the Skeleton's max health exactly what its progression promises.
|
||||
///
|
||||
|
|
@ -260,6 +274,13 @@ namespace RacesOfValheim
|
|||
if (skeletonBodyTransform == null)
|
||||
{
|
||||
GameObject skelPrefab = PrefabManager.Cache.GetPrefab<GameObject>(rules.ModelPrefab);
|
||||
if (skelPrefab == null)
|
||||
{
|
||||
// The human body was switched off two lines up, so an unresolved
|
||||
// model leaves an invisible player rather than an obvious error.
|
||||
// Say so once per tier instead of failing silently.
|
||||
WarnMissingModelOnce(rules.ModelPrefab);
|
||||
}
|
||||
if (skelPrefab != null)
|
||||
{
|
||||
GameObject skelObj = new GameObject(targetBodyName);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue