modernized for 2026 gmod functionality
This commit is contained in:
@@ -146,8 +146,22 @@ JB.Gamemode.TeamBased = true;
|
||||
JB.Gamemode.Name = "Jail Break";
|
||||
|
||||
-- utility functions
|
||||
local function getGamemodeFolder()
|
||||
local gm = GM or GAMEMODE
|
||||
if gm and gm.FolderName and gm.FolderName ~= "" then
|
||||
return gm.FolderName
|
||||
end
|
||||
if engine and engine.ActiveGamemode then
|
||||
local active = engine.ActiveGamemode()
|
||||
if active and active ~= "" then
|
||||
return active
|
||||
end
|
||||
end
|
||||
return "jailbreak"
|
||||
end
|
||||
|
||||
local loadFolder = function(folder,shared)
|
||||
local path = "jailbreak/gamemode/"..folder.."/";
|
||||
local path = getGamemodeFolder().."/gamemode/"..folder.."/";
|
||||
|
||||
for _,name in pairs(file.Find(path.."*.lua","LUA")) do
|
||||
local runtype = shared or "sh";
|
||||
@@ -180,4 +194,4 @@ end
|
||||
|
||||
JB.Util = {};
|
||||
|
||||
assert(loadFolder("util") and loadFolder("core") and loadFolder("classes","sh") and loadFolder("lastrequests","sh") and loadFolder("vgui","cl"),"Failed to load Jail Break 7! Contact a developer!")
|
||||
assert(loadFolder("util") and loadFolder("core") and loadFolder("classes","sh") and loadFolder("lastrequests","sh") and loadFolder("vgui","cl"),"Failed to load Jail Break 7! Contact a developer!")
|
||||
|
||||
Reference in New Issue
Block a user