Skip to content
Snippets Groups Projects
Commit 1c4e870e authored by Eric Wykoff's avatar Eric Wykoff
Browse files

warden weapon swaps no longer make shuffling sounds

parent 472c8e6a
No related branches found
No related tags found
1 merge request!191More fixes
......@@ -3612,7 +3612,7 @@ end
--- Call when an object is worn
-- This doesnt call the base interface onWear, it copies the code because we need some tricky stuff
function _M:onWear(o, inven_id, bypass_set)
function _M:onWear(o, inven_id, bypass_set, silent)
o.wielded = {}
if self.player then o:forAllStack(function(so) so.__transmo = false end) end
......@@ -3749,11 +3749,11 @@ function _M:onWear(o, inven_id, bypass_set)
self:checkTwoHandedPenalty()
self:updateModdableTile()
if self == game.player and not bypass_set then game:playSound("actions/wear") end
if self == game.player and not bypass_set and not self:attr("no_sound") then game:playSound("actions/wear") end
end
--- Call when an object is taken off
function _M:onTakeoff(o, inven_id, bypass_set)
function _M:onTakeoff(o, inven_id, bypass_set, silent)
engine.interface.ActorInventory.onTakeoff(self, o, inven_id)
if o.talent_on_spell then
......@@ -3849,7 +3849,7 @@ function _M:onTakeoff(o, inven_id, bypass_set)
self:checkTwoHandedPenalty()
self:updateModdableTile()
if self == game.player and not bypass_set then game:playSound("actions/takeoff") end
if self == game.player and not bypass_set and not self:attr("no_sound") then game:playSound("actions/takeoff") end
end
function _M:checkTwoHandedPenalty()
......
......@@ -103,7 +103,9 @@ doWardenWeaponSwap = function(self, t, type, silent)
if swap == true then
local old_inv_access = self.no_inventory_access -- Make sure clones can swap
self.no_inventory_access = nil
self:attr("no_sound", 1)
self:quickSwitchWeapons(true, "warden", silent)
self:attr("no_sound", -1)
self.no_inventory_access = old_inv_access
end
......
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