Skip to content

Commit

Permalink
Merge pull request #252 from Bestride/develop
Browse files Browse the repository at this point in the history
Fix some repair bugs
  • Loading branch information
DanSheps committed Aug 24, 2023
2 parents badf13c + 9a0cb9b commit 4068fb8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Versions/Common/BeStride_Constants.lua
Expand Up @@ -214,7 +214,7 @@ BeStride_Constants = {
[125] = {
blocked = true,
except = LibStub("AceLocale-3.0"):GetLocale("BeStride")["Zone.Dalaran.SubZone.KrasusLanding"]
}
},
[127] = {
blocked = true,
},
Expand Down
8 changes: 6 additions & 2 deletions Versions/Common/logic.special.lua
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4068fb8

Please sign in to comment.