// Reason: Recently (probably since GMod 13) gmod is calling gamemode.Register with "base" as third argument no matter what you enter inside the "gamemode info" file // This causes this gamemode to not being able to use the Sandbox features it needs, this script fixes most of it... entities have yet to be fixed... function DeriveSandbox() if gamemode.Get( "sandbox" ) == nil then local szSearchPath = ""; GM_Sandbox = {}; local GM_Code = "local GM = GM_Sandbox;\n"; if SERVER then szSearchPath = "lsv"; GM_Code = GM_Code .. file.Read( "sandbox/gamemode/init.lua", szSearchPath ); elseif CLIENT then szSearchPath = "lcl"; GM_Code = GM_Code .. file.Read( "sandbox/gamemode/cl_init.lua", szSearchPath ); end local OldInclude = include; function include( szFile ) if file.Exists( "sandbox/gamemode/" .. szFile, szSearchPath ) then OldInclude( "sandbox/gamemode/" .. szFile ); elseif file.Exists( "sandbox/gamemode/spawnmenu/" .. szFile, szSearchPath ) then OldInclude( "sandbox/gamemode/spawnmenu/" .. szFile ); else OldInclude( szFile ); end end local OldAddCSLuaFile = AddCSLuaFile; if SERVER then function AddCSLuaFile( szFile ) local szFile = szFile || ""; if !szFile:len() then szFile = debug.getinfo( 2, "n" ).name; end if file.Exists( "sandbox/gamemode/" .. szFile, szSearchPath ) then OldAddCSLuaFile( "sandbox/gamemode/" .. szFile ); elseif file.Exists( "sandbox/gamemode/spawnmenu/" .. szFile, szSearchPath ) then OldAddCSLuaFile( "sandbox/gamemode/spawnmenu/" .. szFile ); else OldAddCSLuaFile( szFile ); end end end RunString( GM_Code ); include = OldInclude; if SERVER then AddCSLuaFile = OldAddCSLuaFile; end gamemode.Register( GM_Sandbox, "sandbox", "base" ); GM_Sandbox = nil; table.Inherit( GM, gamemode.Get( "sandbox" ) ); end end