Skip to content

Commit

Permalink
Fix mudletOlderThan() for 4.0 (#2925) (#2928)
Browse files Browse the repository at this point in the history
* mudletOlderThan fix

* Logic adjustments

* Combine and straighten else clauses

(cherry picked from commit 42295a8)
  • Loading branch information
vadi2 committed Aug 5, 2019
1 parent 23e47c3 commit 48bb417
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/mudlet-lua/lua/Other.lua
Expand Up @@ -643,17 +643,19 @@ function mudletOlderThan(inputmajor, inputminor, inputpatch)
assert(inputminor == nil or type(inputminor) == "number", sformat("bad argument #2 type (optional minor version as number expected, got %s!)", type(inputminor)))
assert(inputpatch == nil or type(inputpatch) == "number", sformat("bad argument #3 type (optional patch version as number expected, got %s!)", type(inputpatch)))


if mudletmajor < inputmajor then
return true
elseif mudletmajor > inputmajor then
return false
elseif inputminor then
if mudletminor < inputminor then
return true
elseif mudletminor > inputminor then
return false
elseif inputpatch and (mudletpatch < inputpatch) then
return true
end
end
if inputminor and (mudletminor < inputminor) then
return true
end
if inputpatch and (mudletpatch < inputpatch) then
return true
end

return false
end

Expand Down

0 comments on commit 48bb417

Please sign in to comment.