summaryrefslogtreecommitdiff
path: root/server/src/vm/ipairs.lua
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/vm/ipairs.lua')
-rw-r--r--server/src/vm/ipairs.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/server/src/vm/ipairs.lua b/server/src/vm/ipairs.lua
index e27b8584..b8d821ef 100644
--- a/server/src/vm/ipairs.lua
+++ b/server/src/vm/ipairs.lua
@@ -33,10 +33,15 @@ function mt:callNext(func, values, source)
local emmy = tbl:getEmmy()
if emmy then
if emmy.type == 'emmy.arrayType' then
- local key = self:createValue('integer', self:getDefaultSource())
+ local key = self:createValue('integer', source)
local value = self:createValue(emmy:getName(), source)
func:setReturn(1, key)
func:setReturn(2, value)
+ elseif emmy.type == 'emmy.tableType' then
+ local key = self:createValue(emmy:getKeyType():getType(), source)
+ local value = self:createValue(emmy:getValueType():getType(), source)
+ func:setReturn(1, key)
+ func:setReturn(2, value)
end
end
end