From f0fc0edd21b9340ce48561a5fceee29e4e055dff Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Fri, 24 Aug 2012 09:49:00 +0000 Subject: cPickup doesn't use cPackets. Also, Lua API change, OnCollectItem -> OnCollectPickup; first param is cPlayer to match other callbacks. git-svn-id: http://mc-server.googlecode.com/svn/trunk@786 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cPlugin_NewLua.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'source/cPlugin_NewLua.cpp') diff --git a/source/cPlugin_NewLua.cpp b/source/cPlugin_NewLua.cpp index a80c8c987..7341a572b 100644 --- a/source/cPlugin_NewLua.cpp +++ b/source/cPlugin_NewLua.cpp @@ -159,20 +159,23 @@ void cPlugin_NewLua::Tick(float a_Dt) -bool cPlugin_NewLua::OnCollectItem( cPickup* a_Pickup, cPlayer* a_Player ) +bool cPlugin_NewLua::OnCollectPickup(cPlayer * a_Player, cPickup * a_Pickup) { - cCSLock Lock( m_CriticalSection ); - if( !PushFunction("OnCollectItem") ) + cCSLock Lock(m_CriticalSection); + if (!PushFunction("OnCollectPickup")) + { return false; + } - tolua_pushusertype(m_LuaState, a_Pickup, "cPickup"); tolua_pushusertype(m_LuaState, a_Player, "cPlayer"); + tolua_pushusertype(m_LuaState, a_Pickup, "cPickup"); - if( !CallFunction(2, 1, "OnCollectItem") ) + if (!CallFunction(2, 1, "OnCollectPickup")) + { return false; + } - bool bRetVal = (tolua_toboolean( m_LuaState, -1, 0) > 0); - return bRetVal; + return (tolua_toboolean(m_LuaState, -1, 0) > 0); } -- cgit v1.2.3