fix return typo + simplify code
This commit is contained in:
parent
2e84b3e675
commit
0d9cfc050c
@ -1,23 +1,14 @@
|
|||||||
local getModeInfo = function()
|
local modeInfo = LobbyData:UITargetFromId(Engine.GetLobbyUIScreen())
|
||||||
local id = Engine.GetLobbyUIScreen()
|
local maxClients = modeInfo.maxClients
|
||||||
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.
|
-- Disable setting party privacy in menu. Auto set to open + max.
|
||||||
Engine.SetDvar("partyprivacyenabled", 0)
|
Engine.SetDvar("partyprivacyenabled", 0)
|
||||||
Engine.SetDvar("tu4_partyprivacyuseglobal", 0)
|
Engine.SetDvar("tu4_partyprivacyuseglobal", 0)
|
||||||
Engine.SetDvar("tu4_partyprivacyluacheck", 0)
|
Engine.SetDvar("tu4_partyprivacyluacheck", 0)
|
||||||
|
|
||||||
local maxClients = getMaxClients()
|
|
||||||
|
|
||||||
-- Fix for invisible bots in custom games
|
-- Fix for invisible bots in custom games
|
||||||
if maxClients >= 1 then
|
if maxClients >= 1 then
|
||||||
return Engine.SetDvar("party_maxplayers", maxClients)
|
Engine.SetDvar("party_maxplayers", maxClients)
|
||||||
end
|
end
|
||||||
|
|
||||||
if not Engine.IsInGame() then
|
if not Engine.IsInGame() then
|
||||||
|
Loading…
Reference in New Issue
Block a user