Robust com_maxclients override

- now sets com_maxclients to lobby default
- supports all modes
This commit is contained in:
WantedDV 2023-04-12 18:29:00 -02:30
parent 56b5d346d4
commit 6a25f0e4ab

View File

@ -7,15 +7,17 @@ CoD.IsTeamChangeAllowed = function()
end
end
-- Set com_maxclients InGame so players can join via direct connect
local maxclients = function()
if Engine.IsZombiesGame() then
return 4
else
return 18
end
local GetModeInfo = function()
local id = Engine.GetLobbyUIScreen()
return LobbyData:UITargetFromId(id)
end
Engine.SetDvar( "com_maxclients", maxclients() )
local GetMaxClients = function()
local ModeInfo = GetModeInfo()
return ModeInfo.maxClients
end
-- Set com_maxclients InGame so players can join via direct connect (default from lobbydata)
Engine.SetDvar( "com_maxclients", GetMaxClients() )
require("DataSources_StartMenuGameOptions")