2023-05-15 15:05:51 -02:30
|
|
|
local getModeInfo = function()
|
|
|
|
local id = Engine.GetLobbyUIScreen()
|
|
|
|
return LobbyData:UITargetFromId(id)
|
|
|
|
end
|
|
|
|
|
|
|
|
local getMaxClients = function()
|
|
|
|
local modeInfo = getModeInfo()
|
|
|
|
return modeInfo.maxClients
|
|
|
|
end
|
|
|
|
|
|
|
|
-- Disable setting party privacy in menu. Auto set to open + max.
|
|
|
|
Engine.SetDvar("partyprivacyenabled", 0)
|
|
|
|
Engine.SetDvar("tu4_partyprivacyuseglobal", 0)
|
|
|
|
Engine.SetDvar("tu4_partyprivacyluacheck", 0)
|
|
|
|
|
|
|
|
local maxClients = getMaxClients()
|
|
|
|
|
|
|
|
-- Fix for invisible bots in custom games
|
|
|
|
if maxClients >= 1 then
|
|
|
|
return Engine.SetDvar("party_maxplayers", maxClients)
|
|
|
|
end
|
|
|
|
|
2023-04-12 19:50:41 -02:30
|
|
|
if not Engine.IsInGame() then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
2023-02-26 00:21:35 +01:00
|
|
|
-- Removed check for public matches to allow team change in ranked matches
|
|
|
|
CoD.IsTeamChangeAllowed = function()
|
2023-04-12 19:51:35 -02:30
|
|
|
if Engine.GetGametypeSetting("allowInGameTeamChange") == 1 then
|
2023-02-26 00:21:35 +01:00
|
|
|
return true
|
|
|
|
else
|
|
|
|
return false
|
|
|
|
end
|
2023-02-28 23:58:07 +01:00
|
|
|
end
|
|
|
|
|
2023-04-12 18:29:00 -02:30
|
|
|
-- Set com_maxclients InGame so players can join via direct connect (default from lobbydata)
|
2023-05-15 15:05:51 -02:30
|
|
|
Engine.SetDvar("com_maxclients", maxClients)
|
2023-04-11 17:26:50 -02:30
|
|
|
|
2023-04-12 19:51:35 -02:30
|
|
|
require("datasources_start_menu_game_options")
|