Fixed a potential deadlock in cChunkMap::m_CSLayers vs cWorld::m_CSAllEntities
git-svn-id: http://mc-server.googlecode.com/svn/trunk@313 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
parent
d9c25a161e
commit
1d1b0fd00d
@ -534,14 +534,16 @@ bool cChunkMap::DigBlock(int a_X, int a_Y, int a_Z, cItem & a_PickupItem)
|
|||||||
|
|
||||||
AbsoluteToRelative( PosX, PosY, PosZ, ChunkX, ChunkZ );
|
AbsoluteToRelative( PosX, PosY, PosZ, ChunkX, ChunkZ );
|
||||||
|
|
||||||
cCSLock Lock(m_CSLayers);
|
|
||||||
cChunkPtr DestChunk = GetChunk( ChunkX, ZERO_CHUNK_Y, ChunkZ );
|
|
||||||
if ((DestChunk == NULL) || !DestChunk->IsValid())
|
|
||||||
{
|
{
|
||||||
return false;
|
cCSLock Lock(m_CSLayers);
|
||||||
}
|
cChunkPtr DestChunk = GetChunk( ChunkX, ZERO_CHUNK_Y, ChunkZ );
|
||||||
|
if ((DestChunk == NULL) || !DestChunk->IsValid())
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
DestChunk->SetBlock(PosX, PosY, PosZ, E_BLOCK_AIR, 0 );
|
DestChunk->SetBlock(PosX, PosY, PosZ, E_BLOCK_AIR, 0 );
|
||||||
|
}
|
||||||
|
|
||||||
m_World->GetSimulatorManager()->WakeUp(a_X, a_Y, a_Z);
|
m_World->GetSimulatorManager()->WakeUp(a_X, a_Y, a_Z);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user