/apps/twnlua: ctx.udata preservation (not yet for reload case)
This commit is contained in:
		| @@ -112,6 +112,12 @@ void game_tick(void) { | ||||
|     State *state = ctx.udata; | ||||
|  | ||||
|     bindgen_build_context(state->L); | ||||
|     lua_getglobal(state->L, "ctx"); | ||||
|     if (!lua_isnoneornil(state->L, -1)) { | ||||
|         lua_getfield(state->L, -1, "udata"); | ||||
|         lua_setfield(state->L, -3, "udata"); | ||||
|     } | ||||
|     lua_pop(state->L, 1); | ||||
|     lua_setglobal(state->L, "ctx"); | ||||
|  | ||||
|     lua_getglobal(state->L, "game_tick"); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user