Skip to content

Commit

Permalink
Fixes #85 - New Mounts added even when not enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
DanSheps committed Nov 8, 2018
1 parent 57caa87 commit 5bafac2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
8 changes: 8 additions & 0 deletions BeStride_Events.lua
@@ -1,5 +1,13 @@
function BeStride:EventNewMount(arg1, arg2)
BeStride:AddNewMount(arg2)
BeStride:AddCommonMount(arg2)
local mount = mountTable.master[arg2]

if BeStride:DBGet("settings.mount.enablenew") then
BeStride:DBSetMount(mount.type,arg2,true)
else
BeStride:DBSetMount(mount.type,arg2,false)
end
end

function BeStride:EventUpdateKeyBinding()
Expand Down
17 changes: 10 additions & 7 deletions BeStride_Mount.lua
Expand Up @@ -58,15 +58,18 @@ end

function BeStride_Mount:Failback()
local mounts = {}

for k,v in pairs(mountTable["master"]) do if self:IsUsable(k) then table.insert(mounts,k) end end

if #mounts == 0 then
BeStride_Debug:Debug("No Mounts")
if BeStride:DBGetSetting("settings.mount.emptyrandom") then
for k,v in pairs(mountTable["master"]) do if self:IsUsable(k) then table.insert(mounts,k) end end

if #mounts == 0 then
BeStride_Debug:Debug("No Mounts")
return nil
end

return self:DoMount(mounts)
else
return nil
end

return self:DoMount(mounts)
end

function BeStride_Mount:Regular()
Expand Down

0 comments on commit 5bafac2

Please sign in to comment.