1. Robin Wellner
  2. selove

Commits

Robin Wellner  committed 2550fa4

Finally fixed frustratring failing, all thanks to bartbes

  • Participants
  • Parent commits a4ed5d3
  • Branches default

Comments (0)

Files changed (1)

File src/modules/thread/sdl/Thread.cpp

View file
  • Ignore whitespace
 			lua_pushlstring(L, name, len);
 		}
 
+		
+		luax_convobj(L, lua_gettop(L), "thread", "getThread");
+		lua_getglobal(L, "love");
+
 		// Sandbox
 		if (luaL_loadbuffer(L, (const char *)love::sandbox_lua, sizeof(love::sandbox_lua), "sandbox.lua") == 0)
 		{
 			lua_call(L, 0, 0);
-			lua_getglobal(L, "love");
-			lua_pushstring(L, "_sandbox");
-			lua_gettable(L, -2);
-			lua_call(L, 0, 0); //?
+			lua_getfield(L, -1, "_sandbox");
+			lua_call(L, 0, 0);
 		}
 
-		 luax_convobj(L, lua_gettop(L), "thread", "getThread");
-		lua_getglobal(L, "love");
 		lua_pushvalue(L, -2);
 		lua_setfield(L, -2, "_curthread");
 		if(luaL_dostring(L, comm->getCode()) == 1)