Added love.isVersionCompatible. Returns true if the running version of love is compatible with the specified version.

This commit is contained in:
Alex Szpakowski
2015-03-13 19:26:09 -03:00
parent a119e6a862
commit 44b9efb43e
3 changed files with 52 additions and 19 deletions
+1 -7
View File
@@ -470,14 +470,8 @@ function love.init()
end
-- Check the version
local compat = false
c.version = tostring(c.version)
for i, v in ipairs(love._version_compat) do
if c.version == v then
compat = true
break
end
end
local compat = love.isVersionCompatible(c.version)
if not compat then
local major, minor, revision = c.version:match("^(%d+)%.(%d+)%.(%d+)$")
if (not major or not minor or not revision) or (major ~= love._version_major and minor ~= love._version_minor) then