Merge pull request #708 from WantedDV/party

Fix: Invisible players/bots in custom games
This commit is contained in:
Maurice Heumann 2023-05-15 21:05:45 +02:00 committed by GitHub
commit b8658b6103

View File

@ -1,3 +1,25 @@
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
if not Engine.IsInGame() then if not Engine.IsInGame() then
return return
end end
@ -11,17 +33,7 @@ CoD.IsTeamChangeAllowed = function()
end end
end end
local getModeInfo = function()
local id = Engine.GetLobbyUIScreen()
return LobbyData:UITargetFromId(id)
end
local getMaxClients = function()
local modeInfo = getModeInfo()
return modeInfo.maxClients
end
-- Set com_maxclients InGame so players can join via direct connect (default from lobbydata) -- Set com_maxclients InGame so players can join via direct connect (default from lobbydata)
Engine.SetDvar("com_maxclients", getMaxClients()) Engine.SetDvar("com_maxclients", maxClients)
require("datasources_start_menu_game_options") require("datasources_start_menu_game_options")