Readded support for 0 points

master
qwertymine3 2015-11-22 19:57:32 +00:00
parent 75dca12b63
commit 0e11a8fc15
2 changed files with 9 additions and 6 deletions

View File

@ -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

View File

@ -19,6 +19,7 @@ planetoids.settings = {
--to be chosen
point_distribution = {
default = 1,
[0] = 0,
[1] = 60,
[2] = 40,
[3] = 40,