Skip to content
Snippets Groups Projects
Commit fcf8d3bf authored by DarkGod's avatar DarkGod
Browse files

mouahhaa

parent a52d8ede
No related branches found
No related tags found
No related merge requests found
......@@ -302,6 +302,7 @@ function _M:listAddons(mod, ignore_compat)
add.natural_compatible = engine.version_nearly_same(mod.version, add.version)
add.version_txt = ("%d.%d.%d"):format(add.version[1], add.version[2], add.version[3])
if add.dlc and not profile:isDonator(add.dlc) then add.dlc = "no" end
if add.id_dlc and not profile:allowDLC(add.id_dlc) then add.id_dlc = "no" end
adds[#adds+1] = add
end
end
......@@ -389,7 +390,10 @@ function _M:loadAddons(mod, saveuse)
print("Removing addon "..add.short_name..": cheat mode required")
table.remove(adds, i) removed = true
elseif add.dlc == "no" then
print("Removing addon "..add.short_name..": DLC required")
print("Removing addon "..add.short_name..": donator required")
table.remove(adds, i) removed = true
elseif add.id_dlc == "no" then
print("Removing addon "..add.short_name..": DLC not granted")
table.remove(adds, i) removed = true
elseif config.settings.addons[add.for_module] and config.settings.addons[add.for_module][add.short_name] ~= nil then
-- Forbidden by config
......
......@@ -890,3 +890,9 @@ function _M:isDonator(s)
if core.steam then return true end
if not self.auth or not tonumber(self.auth.donated) or tonumber(self.auth.donated) < s then return false else return true end
end
function _M:allowDLC(dlc)
if core.steam then if core.steam.checkDLC(dlc[2]) then return true end end
if self.auth and self.auth.dlcs and self.auth.dlcs[dlc[1]] then return true end
return false
end
......@@ -23,7 +23,7 @@ local UserChat = require "profile-thread.UserChat"
module(..., package.seeall, class.make)
local debug = false
local debug = true
local mport = debug and 2259 or 2257
local pport = debug and 2260 or 2258
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment