diff options
author | STRWarrior <niels.breuker@hotmail.nl> | 2014-03-29 15:26:41 +0100 |
---|---|---|
committer | STRWarrior <niels.breuker@hotmail.nl> | 2014-03-29 15:26:41 +0100 |
commit | 339d55511127981335193d07037719a4b26c4600 (patch) | |
tree | a11e1e4ca6a2bceac6b78a070069c93668e66e03 /src/Bindings/PluginLua.cpp | |
parent | Fixed non-virtual destructors warnings. (diff) | |
download | cuberite-339d55511127981335193d07037719a4b26c4600.tar cuberite-339d55511127981335193d07037719a4b26c4600.tar.gz cuberite-339d55511127981335193d07037719a4b26c4600.tar.bz2 cuberite-339d55511127981335193d07037719a4b26c4600.tar.lz cuberite-339d55511127981335193d07037719a4b26c4600.tar.xz cuberite-339d55511127981335193d07037719a4b26c4600.tar.zst cuberite-339d55511127981335193d07037719a4b26c4600.zip |
Diffstat (limited to 'src/Bindings/PluginLua.cpp')
-rw-r--r-- | src/Bindings/PluginLua.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/Bindings/PluginLua.cpp b/src/Bindings/PluginLua.cpp index 4f0e13f12..d4e4b3ee8 100644 --- a/src/Bindings/PluginLua.cpp +++ b/src/Bindings/PluginLua.cpp @@ -1108,6 +1108,26 @@ bool cPluginLua::OnPreCrafting(const cPlayer * a_Player, const cCraftingGrid * a +bool cPluginLua::OnProjectileHitEntity(cProjectileEntity & a_Projectile, cEntity & a_HitEntity) +{ + cCSLock Lock(m_CriticalSection); + bool res = false; + cLuaRefs & Refs = m_HookMap[cPluginManager::HOOK_PROJECTILE_HIT_ENTITY]; + for (cLuaRefs::iterator itr = Refs.begin(), end = Refs.end(); itr != end; ++itr) + { + m_LuaState.Call((int)(**itr), &a_Projectile, &a_HitEntity, cLuaState::Return, res); + if (res) + { + return true; + } + } + return false; +} + + + + + bool cPluginLua::OnSpawnedEntity(cWorld & a_World, cEntity & a_Entity) { cCSLock Lock(m_CriticalSection); |