From 68f3ea56bdcf4664ee119016a0745d46f2c31a65 Mon Sep 17 00:00:00 2001 From: faketruth Date: Sat, 10 Mar 2012 02:39:36 +0000 Subject: You can change axis ordering by setting AXIS_ORDER to AXIS_ORDER_XZY in cChunk.h !THIS WILL SCREW UP YOUR WORLDS THOUGH! Still need to update world storage schemes, converters and such git-svn-id: http://mc-server.googlecode.com/svn/trunk@390 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cWorldGenerator.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/cWorldGenerator.cpp') diff --git a/source/cWorldGenerator.cpp b/source/cWorldGenerator.cpp index 2dfd3a8ee..6884d80b3 100644 --- a/source/cWorldGenerator.cpp +++ b/source/cWorldGenerator.cpp @@ -201,7 +201,7 @@ unsigned int cWorldGenerator::MakeIndex(int x, int y, int z ) { ASSERT((x < cChunk::c_ChunkWidth) && (x > -1) && (y < cChunk::c_ChunkHeight) && (y > -1) && (z < cChunk::c_ChunkWidth) && (z > -1)); - return y + (z * cChunk::c_ChunkHeight) + (x * cChunk::c_ChunkHeight * cChunk::c_ChunkWidth); + return cChunk::MakeIndexNoCheck( x, y, z ); } @@ -433,7 +433,7 @@ void cWorldGenerator::GenerateFoliage(int a_ChunkX, int a_ChunkY, int a_ChunkZ) int xx = x + a_ChunkX * cChunk::c_ChunkWidth; int TopY = m_World->GetHeight(xx, zz); - int index = MakeIndex(x, TopY - 1, z); + int index = cChunk::MakeIndexNoCheck(x, MAX(TopY - 1, 0), z); if (BlockType[index] == BLOCK_GRASS) { float val1 = Noise.CubicNoise2D( xx * 0.1f, zz * 0.1f ); -- cgit v1.2.3