Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. // hide metatable from Lua getmetatable()
  2. lua_pushvalue(L, methods);
  3. set(L, metatable, "__metatable");
  4.  
  5. lua_pushvalue(L, methods);
  6. set(L, metatable, "__index");
  7.  
  8. ///////adding this should work
  9. lua_pushvalue(L, methods);
  10. set(L, metatable, "__newindex");
  11. //////////
  12. lua_pushcfunction(L, tostring_T);
  13. set(L, metatable, "__tostring");
  14.  
  15. lua_pushcfunction(L, gc_T);
  16. set(L, metatable, "__gc");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement