|
@@ -166,7 +166,8 @@ void Chunk::setBlock(Block* block)
|
|
|
void Chunk::removeBlock(Block* zBlock)
|
|
|
{
|
|
|
cs.lock();
|
|
|
- for (Framework::Iterator<Block*> iterator = blocks.begin(); iterator; iterator++)
|
|
|
+ vcs.lock();
|
|
|
+ for (Framework::Iterator<Block*> iterator = visibleBlocks.begin(); iterator; iterator++)
|
|
|
{
|
|
|
if (zBlock == (Block*)iterator)
|
|
|
{
|
|
@@ -174,8 +175,8 @@ void Chunk::removeBlock(Block* zBlock)
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
- vcs.lock();
|
|
|
- for (Framework::Iterator<Block*> iterator = visibleBlocks.begin(); iterator; iterator++)
|
|
|
+ vcs.unlock();
|
|
|
+ for (Framework::Iterator<Block*> iterator = blocks.begin(); iterator; iterator++)
|
|
|
{
|
|
|
if (zBlock == (Block*)iterator)
|
|
|
{
|
|
@@ -183,7 +184,6 @@ void Chunk::removeBlock(Block* zBlock)
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
- vcs.unlock();
|
|
|
cs.unlock();
|
|
|
}
|
|
|
|