Skip to content
Snippets Groups Projects
Commit 050f1ec9 authored by DarkGod's avatar DarkGod
Browse files

moar

parent f8a41e3e
No related branches found
No related tags found
No related merge requests found
......@@ -6079,6 +6079,13 @@ function _M:transmoGetWord()
return "transmogrify"
end
function _M:canUseTinker(tinker)
if not tinker.is_tinker then return nil, "not an attachable item" end
if not self.can_tinker then return nil, "can not use attachements" end
if not self.can_tinker[tinker.is_tinker] then return nil, "can not use attachements of this type" end
return true
end
function _M:doTakeoffTinker(base_o, oldo)
if base_o.tinker ~= oldo then return end
......@@ -6108,8 +6115,9 @@ function _M:doWearTinker(wear_inven, wear_item, wear_o, base_inven, base_item, b
game.logPlayer(self, "You can not use a tinker without the corresponding item.")
return
end
if not wear_o.is_tinker then
game.logPlayer(self, "This item is not a tinker.")
local ok, err = self:canUseTinker(wear_o)
if not ok then
game.logPlayer(self, "This item is not usable: %s.", err)
return
end
if wear_o.on_type and wear_o.on_type ~= rawget(base_o, "type") then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment