1
0

LuaChunkStay: Fixed a crash on unused callback.

This commit is contained in:
Mattes D 2014-10-17 13:17:56 +02:00
parent 8c2a99711e
commit 803666d480

View File

@ -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);