Commit 407c5312 authored by phcoder's avatar phcoder
Browse files

Fix implementation of foreach

Oritinal foreach can correctly traverse the table even when the called
function removes the element. Make it in-line with vanilla pico8

Fixe level skipping in celeste classic
parent e5eb7383
......@@ -24,7 +24,7 @@ end
function foreach(c, f)
if c ~= nil then
for key, value in ipairs(c) do
for value in all(c) do
f(value)
end
end
......
......@@ -25,7 +25,7 @@ const char* lua_api_string =
"\n"
"function foreach(c, f)\n"
" if c ~= nil then\n"
" for key, value in ipairs(c) do\n"
" for value in all(c) do\n"
" f(value)\n"
" end\n"
" end\n"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment