diff --git a/JotunnModStub/HeldItemScaleFix.cs b/JotunnModStub/HeldItemScaleFix.cs index 736c706..b3fdf1d 100644 --- a/JotunnModStub/HeldItemScaleFix.cs +++ b/JotunnModStub/HeldItemScaleFix.cs @@ -31,6 +31,10 @@ namespace RacesOfValheim /// /// Armor (attach_skin) is skinned to the body's bones and follows them whatever its own scale, /// so it is left alone. So are creatures: this is for players only. + /// + /// The Trol's grabbed log (TrolWeapon_*) is left alone too. It is only ever held in True Form, + /// and its 0.4 scale was set by eye on the size it had there before this fix; scaled with the + /// model it came out two and a half times too big. /// [HarmonyPatch(typeof(VisEquipment), "AttachItem")] internal static class HeldItemScaleFix @@ -38,10 +42,13 @@ namespace RacesOfValheim private static readonly AccessTools.FieldRef Visual = AccessTools.FieldRefAccess("m_visual"); - private static void Postfix(VisEquipment __instance, GameObject __result) + private static void Postfix(VisEquipment __instance, GameObject __result, int itemHash) { if (__result == null || !__instance.m_isPlayer) return; + GameObject itemPrefab = ObjectDB.instance != null ? ObjectDB.instance.GetItemPrefab(itemHash) : null; + if (itemPrefab != null && itemPrefab.name.StartsWith("TrolWeapon_")) return; + Transform joint = __result.transform.parent; if (joint == null) return; if (__instance.m_bodyModel != null && joint == __instance.m_bodyModel.transform.parent) return;