1
0

Renamed HOOK_KILLED to HOOK_KILLING to match naming conventions.

Also tweaked the mechanics so that plugins may revive without dropping other plugins out of the picture.

git-svn-id: http://mc-server.googlecode.com/svn/trunk@1182 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
madmaxoft@gmail.com
2013-01-28 16:54:11 +00:00
parent f7721c258b
commit 71bbf2d44b
12 changed files with 38 additions and 41 deletions

View File

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