Fix arithmetic operations on SoundGroup
This commit is contained in:
parent
1085e5e239
commit
13a0bd79a9
7
main.lua
7
main.lua
@ -100,12 +100,15 @@ SoundGroup = {
|
|||||||
|
|
||||||
-- allow arithmetic operation to join groups
|
-- allow arithmetic operation to join groups
|
||||||
__add = function(self, g1)
|
__add = function(self, g1)
|
||||||
local new_group = SoundGroup(self)
|
local new_group = {}
|
||||||
|
for _, snd in ipairs(self) do
|
||||||
|
table.insert(new_group, snd)
|
||||||
|
end
|
||||||
for _, snd in ipairs(g1) do
|
for _, snd in ipairs(g1) do
|
||||||
table.insert(new_group, snd)
|
table.insert(new_group, snd)
|
||||||
end
|
end
|
||||||
|
|
||||||
return new_group
|
return SoundGroup(new_group)
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
setmetatable(def, def.__init)
|
setmetatable(def, def.__init)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user