diff options
Diffstat (limited to '')
-rw-r--r-- | source/cPluginManager.cpp | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/source/cPluginManager.cpp b/source/cPluginManager.cpp index 041180818..788b5e429 100644 --- a/source/cPluginManager.cpp +++ b/source/cPluginManager.cpp @@ -198,22 +198,6 @@ bool cPluginManager::CallHook(PluginHook a_Hook, unsigned int a_NumArgs, ...) switch( a_Hook ) { - case HOOK_COLLECT_ITEM: - { - if( a_NumArgs != 2 ) break; - va_list argptr; - va_start( argptr, a_NumArgs); - cPickup* Pickup = va_arg(argptr, cPickup* ); - cPlayer* Player = va_arg(argptr, cPlayer* ); - va_end (argptr); - for( PluginList::iterator itr = Plugins->second.begin(); itr != Plugins->second.end(); ++itr ) - { - if( (*itr)->OnCollectItem( Pickup, Player ) ) - return true; - } - break; - } - case HOOK_PLAYER_JOIN: { if( a_NumArgs != 1 ) break; @@ -451,6 +435,27 @@ bool cPluginManager::CallHookChunkGenerating(cWorld * a_World, int a_ChunkX, int +bool cPluginManager::CallHookCollectPickup(cPlayer * a_Player, cPickup & a_Pickup) +{ + HookMap::iterator Plugins = m_Hooks.find(HOOK_COLLECT_PICKUP); + if (Plugins == m_Hooks.end()) + { + return false; + } + for (PluginList::iterator itr = Plugins->second.begin(); itr != Plugins->second.end(); ++itr) + { + if ((*itr)->OnCollectPickup(a_Player, &a_Pickup)) + { + return true; + } + } + return false; +} + + + + + bool cPluginManager::CallHookPreCrafting(const cPlayer * a_Player, const cCraftingGrid * a_Grid, cCraftingRecipe * a_Recipe) { HookMap::iterator Plugins = m_Hooks.find(HOOK_PRE_CRAFTING); |