diff --git a/src/models/Diner.lua b/src/models/Diner.lua index 5586156..77fbd34 100644 --- a/src/models/Diner.lua +++ b/src/models/Diner.lua @@ -52,14 +52,14 @@ function Diner:refreshDailyData(notify) end end if show then - table.insert(pool, id) + table.insert(pool, {id, data.chance}) end end end if #pool > 0 then - local idx = math.randomInt(1, #pool) - entrust[i] = pool[idx] + local idx = math.randWeight(pool, 2) + entrust[i] = pool[idx][1] change = true table.remove(pool, idx) end -- libgit2 0.21.2