diff options
author | Mattes D <github@xoft.cz> | 2014-02-01 14:08:08 +0100 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-02-01 14:08:08 +0100 |
commit | 33759197e97000e5be12d4b0daa593c54cdaed7b (patch) | |
tree | b49b2d4e02f973755c7d8007fe1ba082a5666674 /src/Bindings/PluginLua.cpp | |
parent | Merge pull request #613 from UltraCoderRU/master (diff) | |
parent | Added PlayerDestroyedHook Documentation (diff) | |
download | cuberite-33759197e97000e5be12d4b0daa593c54cdaed7b.tar cuberite-33759197e97000e5be12d4b0daa593c54cdaed7b.tar.gz cuberite-33759197e97000e5be12d4b0daa593c54cdaed7b.tar.bz2 cuberite-33759197e97000e5be12d4b0daa593c54cdaed7b.tar.lz cuberite-33759197e97000e5be12d4b0daa593c54cdaed7b.tar.xz cuberite-33759197e97000e5be12d4b0daa593c54cdaed7b.tar.zst cuberite-33759197e97000e5be12d4b0daa593c54cdaed7b.zip |
Diffstat (limited to '')
-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 7b2362887..773d522c4 100644 --- a/src/Bindings/PluginLua.cpp +++ b/src/Bindings/PluginLua.cpp @@ -641,6 +641,26 @@ bool cPluginLua::OnPlayerBrokenBlock(cPlayer & a_Player, int a_BlockX, int a_Blo +bool cPluginLua::OnPlayerDestroyed(cPlayer & a_Player) +{ + cCSLock Lock(m_CriticalSection); + bool res = false; + cLuaRefs & Refs = m_HookMap[cPluginManager::HOOK_PLAYER_DESTROYED]; + for (cLuaRefs::iterator itr = Refs.begin(), end = Refs.end(); itr != end; ++itr) + { + m_LuaState.Call((int)(**itr), &a_Player, cLuaState::Return, res); + if (res) + { + return true; + } + } + return false; +} + + + + + bool cPluginLua::OnPlayerEating(cPlayer & a_Player) { cCSLock Lock(m_CriticalSection); |