17,101
edits
m (Newline fun times) |
m (_formatLootTable: Apply secondary sort on item ID in addition to primary sort on drop chance) |
||
Line 96: | Line 96: | ||
-- Sort table from most to least common drop | -- Sort table from most to least common drop | ||
table.sort(lootTable, function(a, b) | table.sort(lootTable, function(a, b) | ||
return a[2] > b[2] | if a[2] == b[2] then | ||
return a[1] < b[1] | |||
else | |||
return a[2] > b[2] | |||
end | |||
end) | end) | ||