From 9a0cb9bca7dd12cc850962bb1a5749f31a1206fa Mon Sep 17 00:00:00 2001 From: Daniel Sheppard Date: Wed, 23 Aug 2023 21:39:25 -0500 Subject: [PATCH] Fix some repair bugs --- Versions/Common/BeStride_Constants.lua | 2 +- Versions/Common/logic.special.lua | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Versions/Common/BeStride_Constants.lua b/Versions/Common/BeStride_Constants.lua index 8fbb98e..d9da3e9 100644 --- a/Versions/Common/BeStride_Constants.lua +++ b/Versions/Common/BeStride_Constants.lua @@ -214,7 +214,7 @@ BeStride_Constants = { [125] = { blocked = true, except = LibStub("AceLocale-3.0"):GetLocale("BeStride")["Zone.Dalaran.SubZone.KrasusLanding"] - } + }, [127] = { blocked = true, }, diff --git a/Versions/Common/logic.special.lua b/Versions/Common/logic.special.lua index 55e55aa..59221e9 100644 --- a/Versions/Common/logic.special.lua +++ b/Versions/Common/logic.special.lua @@ -20,11 +20,11 @@ end function BeStride:NeedToRepair() -- Check whether we need to repair -- Returns: boolean - if BeStride:ForceRepair() then + if BeStride:IsForceRepair() then return true end - if size(BeStride.db.profile.misc.RepairMounts) > 0 and BeStride:UseRepair() then + if BeStride.db.profile.misc ~= nil and BeStride.db.profile.misc.RepairMounts ~= nil and size(BeStride.db.profile.misc.RepairMounts) > 0 and BeStride:UseRepair() then for i = 0, 17 do local current, maximum = GetInventoryItemDurability(i) if current ~= nil and maximum ~= nil and ( (current/maximum) <= BeStride:GetRepairThreshold() ) then @@ -95,6 +95,10 @@ end function BeStride:IsForceRepair() -- Check whether we force a repair mount -- Returns: boolean + if BeStride.db.profile.settings["repair"] == nil or BeStride.db.profile.settings["repair"]["force"] == nil then + return false + end + if BeStride.db.profile.settings["repair"]["force"] then return true else