summaryrefslogtreecommitdiffstats
path: root/src/Bindings/LuaChunkStay.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/Bindings/LuaChunkStay.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/Bindings/LuaChunkStay.cpp b/src/Bindings/LuaChunkStay.cpp
index a3d3a8090..e50ffb75b 100644
--- a/src/Bindings/LuaChunkStay.cpp
+++ b/src/Bindings/LuaChunkStay.cpp
@@ -13,7 +13,7 @@
cLuaChunkStay::cLuaChunkStay(cPluginLua & a_Plugin) :
m_Plugin(a_Plugin),
- m_LuaState(NULL)
+ m_LuaState(nullptr)
{
}
@@ -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);