From 4eaafbd70f204d620d9211a672d28ec618c01d39 Mon Sep 17 00:00:00 2001 From: faketruth Date: Thu, 11 Oct 2012 20:49:18 +0000 Subject: Got rid of "self" in plugins, which is deprecated anyway Fixed bug in many On* hooks that did not pop the return values from the stack Fixed Plugin:Call() that removed one too many items from the stack git-svn-id: http://mc-server.googlecode.com/svn/trunk@950 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/LuaCommandBinder.cpp | 6 ------ 1 file changed, 6 deletions(-) (limited to 'source/LuaCommandBinder.cpp') diff --git a/source/LuaCommandBinder.cpp b/source/LuaCommandBinder.cpp index a495a2954..7a65cab7f 100644 --- a/source/LuaCommandBinder.cpp +++ b/source/LuaCommandBinder.cpp @@ -81,12 +81,6 @@ bool cLuaCommandBinder::HandleCommand( const std::string & a_Command, cPlayer* a } } - // For enabling 'self' in the function, it's kind of a hack I'm not sure this is the way to go - lua_pushvalue(func.LuaState, LUA_GLOBALSINDEX); - lua_pushstring(func.LuaState, "self"); - tolua_pushusertype( func.LuaState, func.Plugin, "cPlugin" ); - lua_rawset(func.LuaState, -3); - lua_pop(func.LuaState, 1); LOGD("1. Stack size: %i", lua_gettop(func.LuaState) ); lua_rawgeti( func.LuaState, LUA_REGISTRYINDEX, func.Reference); // same as lua_getref() -- cgit v1.2.3