Merge branch 'cachedlevels-lua-why-broke' into 'master'

Fix cup->cachedlevels Lua getter to return entire cachedlevels list.

See merge request kart-krew-dev/ring-racers!73
This commit is contained in:
Eidolon 2025-10-25 20:26:31 -05:00
commit 176713d243

View file

@ -351,13 +351,12 @@ static int cup_get(lua_State *L)
lua_pushstring(L, cup->levellist[i]);
lua_rawseti(L, -2, 1 + i);
}
//return UNIMPLEMENTED;
break;
case cup_cachedlevels:
lua_createtable(L, ((cup->numlevels) + (cup->numbonus)), 0);
for (size_t i = 0; i < ((cup->numlevels) + (cup->numbonus)); i++)
for (size_t i = 0; i < CUPCACHE_MAX; i++)
{
lua_pushnumber(L, cup->cachedlevels[i]);
lua_pushnumber(L, (cup->cachedlevels[i])+1);
lua_rawseti(L, -2, 1 + i);
}
break;