summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-10-17 13:17:56 +0200
committerMattes D <github@xoft.cz>2014-10-17 13:17:56 +0200
commit803666d480317376cf8f6e964ef4996567dea59f (patch)
treecef84c4b98ddf9bbb449f17d5177ca450163fe05 /src
parentMerged branch 'fix_chunks'. (diff)
downloadcuberite-803666d480317376cf8f6e964ef4996567dea59f.tar
cuberite-803666d480317376cf8f6e964ef4996567dea59f.tar.gz
cuberite-803666d480317376cf8f6e964ef4996567dea59f.tar.bz2
cuberite-803666d480317376cf8f6e964ef4996567dea59f.tar.lz
cuberite-803666d480317376cf8f6e964ef4996567dea59f.tar.xz
cuberite-803666d480317376cf8f6e964ef4996567dea59f.tar.zst
cuberite-803666d480317376cf8f6e964ef4996567dea59f.zip
Diffstat (limited to 'src')
-rw-r--r--src/Bindings/LuaChunkStay.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Bindings/LuaChunkStay.cpp b/src/Bindings/LuaChunkStay.cpp
index a3d3a8090..23da12f68 100644
--- a/src/Bindings/LuaChunkStay.cpp
+++ b/src/Bindings/LuaChunkStay.cpp
@@ -130,8 +130,11 @@ void cLuaChunkStay::Enable(cChunkMap & a_ChunkMap, int a_OnChunkAvailableStackPo
void cLuaChunkStay::OnChunkAvailable(int a_ChunkX, int a_ChunkZ)
{
- cPluginLua::cOperation Op(m_Plugin);
- Op().Call((int)m_OnChunkAvailable, a_ChunkX, a_ChunkZ);
+ if (m_OnChunkAvailable.IsValid())
+ {
+ cPluginLua::cOperation Op(m_Plugin);
+ Op().Call((int)m_OnChunkAvailable, a_ChunkX, a_ChunkZ);
+ }
}
@@ -140,6 +143,7 @@ void cLuaChunkStay::OnChunkAvailable(int a_ChunkX, int a_ChunkZ)
bool cLuaChunkStay::OnAllChunksAvailable(void)
{
+ if (m_OnAllChunksAvailable.IsValid())
{
// Call the callback:
cPluginLua::cOperation Op(m_Plugin);