morrowind-mods
morrowind-mods copied to clipboard
UI Expansion: Filled Soul Gem value wrong on tooltip
The value of an unfilled soul gem is always shown in the tooltip even if the soul gem is filled.
For my own purposes I personally hacked around this by preventing the hiding of the default fields for weight and value for soul gems. This is a terrible "fix" since both the correct value and incorrect value is shown. I don't know where the correct value could be attained from or I'd have posted a proper fix. Sorry.
-- Soul gem capacity
elseif e.object.isSoulGem then
local rawSoulValue
pcall(function()
rawSoulValue = e.itemData.soul.soul
end)
if rawSoulValue == nil then
rawSoulValue = 0
end
labelFormatted(e.tooltip, string.format("%s: %u", common.dictionary.soulCapacity, rawSoulValue))
-- Fixup item value based on MCP feature state.
if rawSoulValue > 0 then
if (tes3.hasCodePatchFeature(65)) then
objectValue = (rawSoulValue ^ 3) / 10000 + rawSoulValue * 2
else
objectValue = objectValue * rawSoulValue
end
end
end
This works for me, although I don't know if it's correct or idiomatic.
I think this has been fixed by this (value is correct for me now):
https://github.com/NullCascade/morrowind-mods/commit/ca755ee3b4de89b4b950499a8998c25c9b18d2b6#diff-dc7a88405997f1cc9459f35656b26afbR264
However, the soul size is displayed 3x the actual size of what I get when I try to enchant sh*t: