From 7a597e1cc51f9b27ad29b0fb6919d416ec6d6c9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lilian=20J=C3=B3nsd=C3=B3ttir?= Date: Mon, 9 Aug 2021 10:04:03 -0700 Subject: [PATCH] don't calculate if disabled again --- MWSE/mods/celediel/ASinkingFeeling/main.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/MWSE/mods/celediel/ASinkingFeeling/main.lua b/MWSE/mods/celediel/ASinkingFeeling/main.lua index c058e25..35a7b17 100644 --- a/MWSE/mods/celediel/ASinkingFeeling/main.lua +++ b/MWSE/mods/celediel/ASinkingFeeling/main.lua @@ -50,8 +50,11 @@ local function sinkInWater(e) local downPull = 0 local debugStr = "" + -- don't calculate if disabled + if not config.enabled then + downPull = 0 -- 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) downPull = (config.downPullMultiplier / 10) * armourClass 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) end - -- reset if levitating or mod disabled - if mobile.levitate > 0 or not config.enabled then downPull = 0 end + -- reset if levitating + if mobile.levitate > 0 then downPull = 0 end -- only if mostly underwater to stop pseudo-waterwalking when jumping into water if headHeight <= waterLevel then