[1.7.4] Attachment slot missing in tinker description
Posted: Sun May 21, 2023 4:04 am
So I was digging around in the object description code trying to find where I cound wedge in a mention of which slot a tinker is supposed to attach to (because its absence is vaguely annoying), when I discovered that the code is already supposed to be mentioning that.
The relevant code in Object:getTextualDesc() is:
I've marked the problem points. Using desc.add() instead of desc:add() is an obvious problem [I've made that mistake myself…
], but on further testing, :add() doesn't seem to be what we want to use here, since we're adding a full-blown TString; in my tests, I had to change those calls to desc:merge() to make the slot description appear.
Edit 2022-05-22: In the meantime, I've added some code to Tinker Tinkering to paper over the bug.

Code: Select all
if self.is_tinker then
if self.on_type then
if self.on_subtype then
-- vvvvvvvv
desc.add(("Attach on item of type '#ORANGE#%s / %s#LAST#'"):tformat(self.on_type, self.on_subtype):toTString(), true)
else
-- vvvvvvvv
desc.add(("Attach on item of type '#ORANGE#%s#LAST#'"):tformat(self.on_type):toTString(), true)
end
end
-- vvvvvvvv
if self.on_slot then desc.add(("Attach on item worn on slot '#ORANGE#%s#LAST#'"):tformat(_t(self.on_slot, "entity on slot"):lower():gsub('_', ' ')):toTString(), true) end
if self.object_tinker and (self.object_tinker.combat or self.object_tinker.wielder) then
desc:add({"color","YELLOW"}, _t"When attach to an other item:", {"color", "LAST"}, true)
if self.object_tinker.combat then desc_combat(self.object_tinker, compare_with, "combat") end
if self.object_tinker.wielder then desc_wielder(self.object_tinker, compare_with, "wielder") end
end
end


Edit 2022-05-22: In the meantime, I've added some code to Tinker Tinkering to paper over the bug.