diff options
author | faketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-08-15 23:24:11 +0200 |
---|---|---|
committer | faketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-08-15 23:24:11 +0200 |
commit | d21e4dacf7341b924fa534523ba31348ff6789ad (patch) | |
tree | 95a8b355c471cd2ab39e58f3d80b63d64ab8510a /source/cPluginManager.cpp | |
parent | Added temporary debug statistics of the RelEntMoveLook packet removal efficiency (diff) | |
download | cuberite-d21e4dacf7341b924fa534523ba31348ff6789ad.tar cuberite-d21e4dacf7341b924fa534523ba31348ff6789ad.tar.gz cuberite-d21e4dacf7341b924fa534523ba31348ff6789ad.tar.bz2 cuberite-d21e4dacf7341b924fa534523ba31348ff6789ad.tar.lz cuberite-d21e4dacf7341b924fa534523ba31348ff6789ad.tar.xz cuberite-d21e4dacf7341b924fa534523ba31348ff6789ad.tar.zst cuberite-d21e4dacf7341b924fa534523ba31348ff6789ad.zip |
Diffstat (limited to 'source/cPluginManager.cpp')
-rw-r--r-- | source/cPluginManager.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/source/cPluginManager.cpp b/source/cPluginManager.cpp index 64f6442ca..a722520bf 100644 --- a/source/cPluginManager.cpp +++ b/source/cPluginManager.cpp @@ -4,20 +4,21 @@ #include "cPlugin.h" #include "cPlugin_Lua.h" #include "cPlugin_NewLua.h" -#include "cPlugin_Squirrel.h" #include "cWebAdmin.h" #include "cItem.h" #include "cRoot.h" #include "cLuaCommandBinder.h" -#include "cSquirrelCommandBinder.h" +#if USE_SQUIRREL +# include "cPlugin_Squirrel.h" +# include "cSquirrelCommandBinder.h" +#endif #include "../iniFile/iniFile.h" #include "tolua++.h" #include "cPlayer.h" -#include "squirrelbindings/SquirrelBindings.h" -#include "squirrelbindings/SquirrelFunctions.h" - #if USE_SQUIRREL + #include "squirrelbindings/SquirrelBindings.h" + #include "squirrelbindings/SquirrelFunctions.h" #pragma warning(disable:4100;disable:4127;disable:4510;disable:4610;disable:4244;disable:4512) // Getting A LOT of these warnings from SqPlus #pragma warning(default:4100;default:4127;default:4510;default:4610;default:4244;default:4512) @@ -39,7 +40,9 @@ cPluginManager* cPluginManager::GetPluginManager() cPluginManager::cPluginManager() : m_LuaCommandBinder( new cLuaCommandBinder() ) +#if USE_SQUIRREL , m_SquirrelCommandBinder( new cSquirrelCommandBinder() ) +#endif , m_bReloadPlugins(false) { } @@ -53,7 +56,9 @@ cPluginManager::~cPluginManager() UnloadPluginsNow(); delete m_LuaCommandBinder; +#if USE_SQUIRREL delete m_SquirrelCommandBinder; +#endif } @@ -197,10 +202,12 @@ bool cPluginManager::CallHook(PluginHook a_Hook, unsigned int a_NumArgs, ...) cPlayer * Player = va_arg(argptr, cPlayer * ); va_end (argptr); +#if USE_SQUIRREL if (m_SquirrelCommandBinder->HandleCommand( std::string( Message ), Player)) { return true; } +#endif if (m_LuaCommandBinder->HandleCommand( std::string( Message ), Player)) { @@ -682,7 +689,9 @@ void cPluginManager::RemovePlugin( cPlugin* a_Plugin, bool a_bDelete /* = false if( a_bDelete ) { m_LuaCommandBinder->RemoveBindingsForPlugin( a_Plugin ); +#if USE_SQUIRREL m_SquirrelCommandBinder->RemoveBindingsForPlugin( a_Plugin ); +#endif m_Plugins.remove( a_Plugin ); RemoveHooks( a_Plugin ); a_Plugin->OnDisable(); |