don't calculate if disabled again
This commit is contained in:
parent
be6e7b7ac4
commit
7a597e1cc5
1 changed files with 6 additions and 3 deletions
|
@ -50,8 +50,11 @@ local function sinkInWater(e)
|
||||||
local downPull = 0
|
local downPull = 0
|
||||||
local debugStr = ""
|
local debugStr = ""
|
||||||
|
|
||||||
|
-- don't calculate if disabled
|
||||||
|
if not config.enabled then
|
||||||
|
downPull = 0
|
||||||
-- calculate the down-pull with the configured formula
|
-- calculate the down-pull with the configured formula
|
||||||
if config.mode == common.modes.equippedArmour then
|
elseif config.mode == common.modes.equippedArmour then
|
||||||
local armourClass = getTotalArmourClass(actor)
|
local armourClass = getTotalArmourClass(actor)
|
||||||
downPull = (config.downPullMultiplier / 10) * armourClass
|
downPull = (config.downPullMultiplier / 10) * armourClass
|
||||||
debugStr = string.format("Pulling %s down by %s using equipped armour mode (%s total armour class)",
|
debugStr = string.format("Pulling %s down by %s using equipped armour mode (%s total armour class)",
|
||||||
|
@ -72,8 +75,8 @@ local function sinkInWater(e)
|
||||||
ref.id, downPull, encumbrance.current, encumbrance.base, encumbrance.normalized)
|
ref.id, downPull, encumbrance.current, encumbrance.base, encumbrance.normalized)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- reset if levitating or mod disabled
|
-- reset if levitating
|
||||||
if mobile.levitate > 0 or not config.enabled then downPull = 0 end
|
if mobile.levitate > 0 then downPull = 0 end
|
||||||
|
|
||||||
-- only if mostly underwater to stop pseudo-waterwalking when jumping into water
|
-- only if mostly underwater to stop pseudo-waterwalking when jumping into water
|
||||||
if headHeight <= waterLevel then
|
if headHeight <= waterLevel then
|
||||||
|
|
Loading…
Add table
Reference in a new issue