From e1b5f0af046f2c4c05789adf33eef5404adba2c3 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Thu, 14 Jun 2012 19:20:31 +0000 Subject: Renamed HOOK_WEATHER_CHANGE to HOOK_WEATHER_CHANGED, added the glue code for it to actually work git-svn-id: http://mc-server.googlecode.com/svn/trunk@610 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cPlugin_NewLua.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'source/cPlugin_NewLua.cpp') diff --git a/source/cPlugin_NewLua.cpp b/source/cPlugin_NewLua.cpp index dd6b61b9b..7254bef01 100644 --- a/source/cPlugin_NewLua.cpp +++ b/source/cPlugin_NewLua.cpp @@ -508,6 +508,29 @@ bool cPlugin_NewLua::OnBlockToPickup( +bool cPlugin_NewLua::OnWeatherChanged(cWorld * a_World) +{ + cCSLock Lock(m_CriticalSection); + if (!PushFunction("OnWeatherChanged")) + { + return false; + } + + tolua_pushusertype(m_LuaState, (void *)a_World, "cWorld"); + + if (!CallFunction(1, 1, "OnWeatherChanged")) + { + return false; + } + + bool bRetVal = (tolua_toboolean( m_LuaState, -1, 0) > 0); + return bRetVal; +} + + + + + cWebPlugin_Lua* cPlugin_NewLua::CreateWebPlugin(lua_State* a_LuaState) { cCSLock Lock( m_CriticalSection ); -- cgit v1.2.3