Open 12345swordy opened 3 weeks ago
Generally anything not within a loop that starts like this:
for (lua_pushnil(L); lua_next(L, SOME_NUMBER) != 0; lua_pop(L, 1)) {
is not applicable.
A caveat is that sometimes it's a var passed from outside the loop. For example
https://github.com/beyond-all-reason/spring/blob/ce86af7df7524a799d804e903e7851a6f7c85ae1/rts/Lua/LuaUnsyncedCtrl.cpp#L1296
unitIndexInTable
is passed -1 from here:
https://github.com/beyond-all-reason/spring/blob/ce86af7df7524a799d804e903e7851a6f7c85ae1/rts/Lua/LuaUnsyncedCtrl.cpp#L1320
Attempting to fix #1530 CC @sprunk Let me know if I did something wrong in this PR