Original Post
I have no idea why this wont work. Needs a new set of (more experienced) eyes to take a look at it.
Lua table;
C++
Basically its just filling the array with random garbage.
If i change it to maplist[0] it works. (obviously overwrites it twice though)
Any tips? Maybe even a better way to do it?
Edit: Ok? Not initializing the array was apparently the problem. *shrug* Resolved now, I guess?
Lua table;
maplist = {"sand.obj", "jungle.obj", "cubes.obj"}C++
//populate the map list array
stringw maplist[50];
int i = 0;
lua_getglobal(L, "maplist");
lua_pushnil(L);
while(lua_next(L, -2))
{
maplist = (stringw)lua_tostring(L, -1);
i++;
lua_pop(L, 1);
}
lua_pop(L, 1);
Basically its just filling the array with random garbage.
If i change it to maplist[0] it works. (obviously overwrites it twice though)
Any tips? Maybe even a better way to do it?
Edit: Ok? Not initializing the array was apparently the problem. *shrug* Resolved now, I guess?