inext returns 0-based indexes

Issue #53 open
mezzodrinker created an issue

Take the following script:

table = { 1, 2, [42]=42 }
i,v = inext(table, 1)
print(i, '->', v)

Since the index following 1 is 2 and the value assigned to index 2 is also 2, this snippet should print 2 -> 2. In MobTalkerScript, though, the output is 1 -> 2 because the 0-based Java index is returned without turning it into a 1-based MTS/Lua index.

Comments (2)

  1. Log in to comment