I thought it was improper indenting of the if and elseif blocks, but I tried to give them proper indent and it's still impossible to close.
Code: Select all
function _M:use(item)
if not item then return end
game:unregisterDialog(self)
local act = item.action
--if act == "use" then
--self.actor:playerUseItem(self.object, self.item, self.inven, self.onuse)
--self.onuse(self.inven, self.item, self.object, true)
--else
if act == "drop" then
self.actor:doDrop(self.inven, self.item, function() self.onuse(self.inven, self.item, self.object, false) end)
elseif act == "wear" then
self.actor:doWear(self.inven, self.item, self.object)
self.onuse(self.inven, self.item, self.object, false)
elseif act == "takeoff" then
self.actor:doTakeoff(self.inven, self.item, self.object)
self.onuse(self.inven, self.item, self.object, false)
end
end