chore(release): v1.4.18 - Valheim hotfix flight fix, 1.0 shop fixes, Fenrir speed
Drake flight resolves ZInput.GetJoyLeftStickY at runtime, since the hotfix dropped its bool parameter. Faction merchant TradeItems now set the 1.0 fields StoreGui dereferences (m_tooltip, m_buyPlayerEffects), and the Dvergar trader discount clones the whole TradeItem instead of rebuilding four fields. Trol totem refusals return true so vanilla's $msg_cantuseon no longer covers them. The Fenrir curse speed modifier is the bonus alone (SE_Stats adds it), not 1 + bonus. New Discord link. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
8aa917cfcb
commit
c7cbd6bece
9 changed files with 59 additions and 17 deletions
|
|
@ -281,17 +281,19 @@ namespace RacesOfValheim
|
|||
{
|
||||
if (item == null) continue;
|
||||
|
||||
discounted.Add(new Trader.TradeItem
|
||||
{
|
||||
m_prefab = item.m_prefab,
|
||||
m_stack = item.m_stack,
|
||||
m_price = Mathf.Max(1, Mathf.RoundToInt(item.m_price * (1f - discount))),
|
||||
m_requiredGlobalKey = item.m_requiredGlobalKey
|
||||
});
|
||||
// A full copy, not a hand-picked one: Valheim 1.0 hangs name, tooltip, icon,
|
||||
// buy/increment keys and buy effects off TradeItem, and StoreGui reads some
|
||||
// of them without null checks. Only the price is ours to change.
|
||||
var copy = (Trader.TradeItem)MemberwiseCloneMethod.Invoke(item, null);
|
||||
copy.m_price = Mathf.Max(1, Mathf.RoundToInt(item.m_price * (1f - discount)));
|
||||
discounted.Add(copy);
|
||||
}
|
||||
|
||||
__result = discounted;
|
||||
}
|
||||
|
||||
private static readonly System.Reflection.MethodInfo MemberwiseCloneMethod =
|
||||
AccessTools.Method(typeof(object), "MemberwiseClone");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue