diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-01-28 17:54:11 +0100 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-01-28 17:54:11 +0100 |
commit | 71bbf2d44ba5fc00fcb15ed96aff083342309498 (patch) | |
tree | 94657c14eddc2f81fe55d8c6a15e22165f6d7897 /source/Plugin_NewLua.cpp | |
parent | Updated HookNotify with the hook renaming. (diff) | |
download | cuberite-71bbf2d44ba5fc00fcb15ed96aff083342309498.tar cuberite-71bbf2d44ba5fc00fcb15ed96aff083342309498.tar.gz cuberite-71bbf2d44ba5fc00fcb15ed96aff083342309498.tar.bz2 cuberite-71bbf2d44ba5fc00fcb15ed96aff083342309498.tar.lz cuberite-71bbf2d44ba5fc00fcb15ed96aff083342309498.tar.xz cuberite-71bbf2d44ba5fc00fcb15ed96aff083342309498.tar.zst cuberite-71bbf2d44ba5fc00fcb15ed96aff083342309498.zip |
Diffstat (limited to 'source/Plugin_NewLua.cpp')
-rw-r--r-- | source/Plugin_NewLua.cpp | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/source/Plugin_NewLua.cpp b/source/Plugin_NewLua.cpp index 418c484ad..ed497e1a9 100644 --- a/source/Plugin_NewLua.cpp +++ b/source/Plugin_NewLua.cpp @@ -14,26 +14,23 @@ extern "C" #include "Bindings.h" #include "ManualBindings.h" -#ifdef _WIN32 -// #include "wdirent.h" -#else -#include <dirent.h> -#endif +extern bool report_errors(lua_State * lua, int status); -extern bool report_errors(lua_State* lua, int status); +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// cPlugin_NewLua: -cPlugin_NewLua::cPlugin_NewLua( const AString & a_PluginDirectory ) +cPlugin_NewLua::cPlugin_NewLua(const AString & a_PluginDirectory) : m_LuaState( 0 ) , cWebPlugin() - , cPlugin( a_PluginDirectory ) + , cPlugin(a_PluginDirectory) { } @@ -389,17 +386,17 @@ bool cPlugin_NewLua::OnHandshake(cClientHandle * a_Client, const AString & a_Use -bool cPlugin_NewLua::OnKilled(cPawn & a_Killed, cEntity * a_Killer) +bool cPlugin_NewLua::OnKilling(cPawn & a_Victim, cEntity * a_Killer) { cCSLock Lock(m_CriticalSection); - const char * FnName = GetHookFnName(cPluginManager::HOOK_KILLED); + const char * FnName = GetHookFnName(cPluginManager::HOOK_KILLING); ASSERT(FnName != NULL); if (!PushFunction(FnName)) { return false; } - tolua_pushusertype(m_LuaState, &a_Killed, "cPawn"); + tolua_pushusertype(m_LuaState, &a_Victim, "cPawn"); tolua_pushusertype(m_LuaState, a_Killer, "cEntity"); if (!CallFunction(2, 1, FnName)) @@ -1194,7 +1191,7 @@ const char * cPlugin_NewLua::GetHookFnName(cPluginManager::PluginHook a_Hook) case cPluginManager::HOOK_CRAFTING_NO_RECIPE: return "OnCraftingNoRecipe"; case cPluginManager::HOOK_DISCONNECT: return "OnDisconnect"; case cPluginManager::HOOK_HANDSHAKE: return "OnHandshake"; - case cPluginManager::HOOK_KILLED: return "OnKilled"; + case cPluginManager::HOOK_KILLING: return "OnKilling"; case cPluginManager::HOOK_LOGIN: return "OnLogin"; case cPluginManager::HOOK_PLAYER_BREAKING_BLOCK: return "OnPlayerBreakingBlock"; case cPluginManager::HOOK_PLAYER_BROKEN_BLOCK: return "OnPlayerBrokenBlock"; |