From 7e20ccc36ce1301298b0ffd2a2c5caf902785b34 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 23 Jun 2005 08:42:48 +0000 Subject: [PATCH] don't point the metatable at the methods table; comment --- stepmania/src/LuaBinding.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/stepmania/src/LuaBinding.h b/stepmania/src/LuaBinding.h index 1137a527a5..455f5aa3a3 100644 --- a/stepmania/src/LuaBinding.h +++ b/stepmania/src/LuaBinding.h @@ -34,9 +34,11 @@ public: luaL_newmetatable( L, m_sClassName ); int metatable = lua_gettop( L ); + // We use the metatable to determine the type of the table, so don't + // allow it to be changed. lua_pushliteral( L, "__metatable" ); - lua_pushvalue( L, methods ); - lua_settable( L, metatable ); // hide metatable from Lua getmetatable() + lua_pushstring( L, "(hidden)" ); + lua_settable( L, metatable ); lua_pushliteral( L, "__index" ); lua_pushvalue( L, methods );