1
0

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
This commit is contained in:
faketruth
2012-10-11 20:49:18 +00:00
parent 3b125d47d1
commit 4eaafbd70f
3 changed files with 29 additions and 12 deletions

View File

@@ -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()