Skip to content
Snippets Groups Projects
Commit acd733f7 authored by Alex Ksandra's avatar Alex Ksandra
Browse files

Fixed onTakeoff call and only if mustwear

parent 61a3962a
No related branches found
No related tags found
1 merge request!88Potentially gamebreaking bug fix
......@@ -6335,10 +6335,13 @@ end
function _M:doTakeoffTinker(base_o, oldo)
if base_o.tinker ~= oldo then return end
local _, _, base_inven = self:findInAllInventoriesByObject(base_o)
local base_inven
local mustwear = base_o.wielded
if mustwear then self:onTakeoff(base_o, true) end
if mustwear then
_, _, base_inven = self:findInAllInventoriesByObject(base_o)
self:onTakeoff(base_o, base_inven, true)
end
base_o.tinker = nil
local forbid = oldo:check("on_untinker", base_o, self)
if oldo.tinkered then
......@@ -6349,7 +6352,9 @@ function _M:doTakeoffTinker(base_o, oldo)
end
end
oldo.tinkered = nil
if mustwear then self:onWear(base_o, base_inven, true) end
if mustwear then
self:onWear(base_o, base_inven, true)
end
self:addObject(self.INVEN_INVEN, oldo)
game.logPlayer(self, "You detach %s from your %s.", oldo:getName{do_color=true}, base_o:getName{do_color=true})
......@@ -6386,7 +6391,7 @@ function _M:doWearTinker(wear_inven, wear_item, wear_o, base_inven, base_item, b
end
local mustwear = base_o.wielded
if mustwear then self:onTakeoff(base_o, true) end
if mustwear then self:onTakeoff(base_o, base_inven, true) end
wear_o.tinkered = {}
local forbid = wear_o:check("on_tinker", base_o, self)
......
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