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
end end
-- Set com_maxclients InGame so players can join via direct connect local GetModeInfo = function()
local maxclients = function() local id = Engine.GetLobbyUIScreen()
if Engine.IsZombiesGame() then return LobbyData:UITargetFromId(id)
return 4
else
return 18
end
end 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") require("DataSources_StartMenuGameOptions")