Added the "/regeneratechunk" command that regenerates either current chunk or a chunk specified with x, z parameters. TODO: permissions - we don't want guests erasing our chunks!
git-svn-id: http://mc-server.googlecode.com/svn/trunk@454 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
@@ -897,6 +897,22 @@ void cChunkMap::ChunksStay(const cChunkCoordsList & a_Chunks, bool a_Stay)
|
||||
|
||||
|
||||
|
||||
void cChunkMap::MarkChunkRegenerating(int a_ChunkX, int a_ChunkZ)
|
||||
{
|
||||
cCSLock Lock(m_CSLayers);
|
||||
cChunkPtr Chunk = GetChunkNoLoad(a_ChunkX, ZERO_CHUNK_Y, a_ChunkZ);
|
||||
if (Chunk == NULL)
|
||||
{
|
||||
// Not present
|
||||
return;
|
||||
}
|
||||
Chunk->MarkRegenerating();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void cChunkMap::Tick( float a_Dt, MTRand & a_TickRandom )
|
||||
{
|
||||
cCSLock Lock(m_CSLayers);
|
||||
@@ -971,7 +987,6 @@ cChunkPtr cChunkMap::cChunkLayer::GetChunk( int a_ChunkX, int a_ChunkY, int a_Ch
|
||||
const int LocalX = a_ChunkX - m_LayerX * LAYER_SIZE;
|
||||
const int LocalZ = a_ChunkZ - m_LayerZ * LAYER_SIZE;
|
||||
|
||||
|
||||
if (!((LocalX < LAYER_SIZE) && (LocalZ < LAYER_SIZE) && (LocalX > -1) && (LocalZ > -1)))
|
||||
{
|
||||
ASSERT(!"Asking a cChunkLayer for a chunk that doesn't belong to it!");
|
||||
|
||||
Reference in New Issue
Block a user