some progress on buy modes

This commit is contained in:
Simon Hirsig
2015-10-20 11:48:29 +02:00
parent 1caa4c9dde
commit 30843adc53
3 changed files with 15 additions and 12 deletions
+2 -2
View File
@@ -236,12 +236,12 @@ function Aux.util.money_string(money)
end
end
function Aux.util.group_by(tables, keys)
function Aux.util.group_by(tables, equal)
local groups = {}
for _, table in ipairs(tables) do
local found_group
for _, group in ipairs(groups) do
if Aux.util.all(keys, function(key) return table[key] == group[1][key] end) then
if equal(table, group[1]) then
tinsert(group, table)
found_group = true
end