Readded support for 0 points
parent
75dca12b63
commit
0e11a8fc15
14
init.lua
14
init.lua
|
@ -139,12 +139,14 @@ local generate_points = function(sector,seed)
|
|||
local num = prand:next(1,point_dist.rand_max)
|
||||
local set = false
|
||||
local cum = 0
|
||||
for i=#point_dist,1,-1 do
|
||||
cum = point_dist[i] + cum
|
||||
if num <= cum then
|
||||
num = i
|
||||
set = true
|
||||
break
|
||||
for i=#point_dist,0,-1 do
|
||||
if point_dist[i] then
|
||||
cum = point_dist[i] + cum
|
||||
if num <= cum then
|
||||
num = i
|
||||
set = true
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@ planetoids.settings = {
|
|||
--to be chosen
|
||||
point_distribution = {
|
||||
default = 1,
|
||||
[0] = 0,
|
||||
[1] = 60,
|
||||
[2] = 40,
|
||||
[3] = 40,
|
||||
|
|
Loading…
Reference in New Issue