1
0

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
This commit is contained in:
madmaxoft@gmail.com
2012-06-14 19:20:31 +00:00
parent 0f39e9b10b
commit e1b5f0af04
8 changed files with 152 additions and 7 deletions

View File

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