summaryrefslogtreecommitdiffstats
path: root/source/cPlugin_NewLua.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-08-19 21:42:32 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-08-19 21:42:32 +0200
commit427e582d5fcbd5025a81a4e89ccada47877ccc64 (patch)
tree1196585a1a6fdc39c6a05aa117cfa2766f7dca2f /source/cPlugin_NewLua.cpp
parentAndroid: Do not create an input thread for Android (diff)
downloadcuberite-427e582d5fcbd5025a81a4e89ccada47877ccc64.tar
cuberite-427e582d5fcbd5025a81a4e89ccada47877ccc64.tar.gz
cuberite-427e582d5fcbd5025a81a4e89ccada47877ccc64.tar.bz2
cuberite-427e582d5fcbd5025a81a4e89ccada47877ccc64.tar.lz
cuberite-427e582d5fcbd5025a81a4e89ccada47877ccc64.tar.xz
cuberite-427e582d5fcbd5025a81a4e89ccada47877ccc64.tar.zst
cuberite-427e582d5fcbd5025a81a4e89ccada47877ccc64.zip
Diffstat (limited to 'source/cPlugin_NewLua.cpp')
-rw-r--r--source/cPlugin_NewLua.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/source/cPlugin_NewLua.cpp b/source/cPlugin_NewLua.cpp
index 55010c3b2..fcea9e475 100644
--- a/source/cPlugin_NewLua.cpp
+++ b/source/cPlugin_NewLua.cpp
@@ -184,20 +184,23 @@ bool cPlugin_NewLua::OnCollectItem( cPickup* a_Pickup, cPlayer* a_Player )
-bool cPlugin_NewLua::OnDisconnect(const AString & a_Reason, cPlayer* a_Player )
+bool cPlugin_NewLua::OnDisconnect(cPlayer * a_Player, const AString & a_Reason)
{
- cCSLock Lock( m_CriticalSection );
- if( !PushFunction("OnDisconnect") )
+ cCSLock Lock(m_CriticalSection);
+ if (!PushFunction("OnDisconnect"))
+ {
return false;
+ }
- tolua_pushstring( m_LuaState, a_Reason.c_str() );
tolua_pushusertype(m_LuaState, a_Player, "cPlayer");
+ tolua_pushstring (m_LuaState, a_Reason.c_str());
- if( !CallFunction(2, 1, "OnDisconnect") )
+ if (!CallFunction(2, 1, "OnDisconnect"))
+ {
return false;
+ }
- bool bRetVal = (tolua_toboolean( m_LuaState, -1, 0) > 0);
- return bRetVal;
+ return (tolua_toboolean( m_LuaState, -1, 0) > 0);
}