Fix bug in map selection (#902)
This commit is contained in:
parent
8c944a57af
commit
cd6c8e74f3
1 changed files with 3 additions and 4 deletions
|
@ -277,15 +277,14 @@ local function select_map()
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
-- Choose next map index, but don't select the same one again
|
-- Choose next map index, but don't select the same one again
|
||||||
if ctf_map.map then
|
if ctf_map.map and #ctf_map.available_maps > 1 then
|
||||||
idx = math.random(#ctf_map.available_maps - 1)
|
idx = math.random(1, #ctf_map.available_maps - 1)
|
||||||
if idx >= ctf_map.map.idx then
|
if idx >= ctf_map.map.idx then
|
||||||
idx = idx + 1
|
idx = idx + 1
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
idx = math.random(#ctf_map.available_maps)
|
idx = math.random(1, #ctf_map.available_maps)
|
||||||
end
|
end
|
||||||
ctf_map.next_idx = (idx % #ctf_map.available_maps) + 1
|
|
||||||
end
|
end
|
||||||
return idx
|
return idx
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue