mirror of
https://github.com/citizenfx/cfx-server-data.git
synced 2025-02-13 17:53:16 +08:00
mapmanager: better randomized roundEnd map rotation
This commit is contained in:
parent
3c6a2b6859
commit
23a840f780
@ -156,11 +156,20 @@ local function handleRoundEnd()
|
|||||||
if data.gameTypes[currentGameType] then
|
if data.gameTypes[currentGameType] then
|
||||||
table.insert(possibleMaps, map)
|
table.insert(possibleMaps, map)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if #possibleMaps > 0 then
|
if #possibleMaps > 1 then
|
||||||
local rnd = math.random(#possibleMaps)
|
local mapname = currentMap
|
||||||
changeMap(possibleMaps[rnd])
|
|
||||||
|
while mapname == currentMap do
|
||||||
|
local rnd = math.random(#possibleMaps)
|
||||||
|
mapname = possibleMaps[rnd]
|
||||||
|
end
|
||||||
|
|
||||||
|
changeMap(mapname)
|
||||||
|
elseif #possibleMaps > 0 then
|
||||||
|
local rnd = math.random(#possibleMaps)
|
||||||
|
changeMap(possibleMaps[rnd])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user