diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-03-03 16:02:50 +0100 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-03-03 16:02:50 +0100 |
commit | a2925ee6c83fa1db41fb8e27444a4e76bd858de4 (patch) | |
tree | 62ebcc473e3082db645bbfc70f0374306b902958 | |
parent | Debuggers plugin no longer performs generator / blockarea interface testing by default, but writes the current API.txt file. (diff) | |
download | cuberite-a2925ee6c83fa1db41fb8e27444a4e76bd858de4.tar cuberite-a2925ee6c83fa1db41fb8e27444a4e76bd858de4.tar.gz cuberite-a2925ee6c83fa1db41fb8e27444a4e76bd858de4.tar.bz2 cuberite-a2925ee6c83fa1db41fb8e27444a4e76bd858de4.tar.lz cuberite-a2925ee6c83fa1db41fb8e27444a4e76bd858de4.tar.xz cuberite-a2925ee6c83fa1db41fb8e27444a4e76bd858de4.tar.zst cuberite-a2925ee6c83fa1db41fb8e27444a4e76bd858de4.zip |
-rw-r--r-- | source/Generating/FinishGen.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/source/Generating/FinishGen.cpp b/source/Generating/FinishGen.cpp index 84aa019af..83788fcab 100644 --- a/source/Generating/FinishGen.cpp +++ b/source/Generating/FinishGen.cpp @@ -429,6 +429,7 @@ void cFinishGenPreSimulator::CollapseSandGravel( for (int x = 0; x < cChunkDef::Width; x++) { int LastY = -1; + int HeightY = 0; for (int y = 0; y < cChunkDef::Height; y++) { BLOCKTYPE Block = cChunkDef::GetBlock(a_BlockTypes, x, y, z); @@ -438,16 +439,22 @@ void cFinishGenPreSimulator::CollapseSandGravel( { // Set the last block onto which stuff can fall to this height: LastY = y; + HeightY = y; break; } case E_BLOCK_AIR: + { + // Do nothing + break; + } case E_BLOCK_FIRE: case E_BLOCK_WATER: case E_BLOCK_STATIONARY_WATER: case E_BLOCK_LAVA: case E_BLOCK_STATIONARY_LAVA: { - // Do nothing + // Do nothing, only remember this height as potentially highest + HeightY = y; break; } case E_BLOCK_SAND: @@ -459,11 +466,15 @@ void cFinishGenPreSimulator::CollapseSandGravel( cChunkDef::SetBlock(a_BlockTypes, x, y, z, E_BLOCK_AIR); } LastY++; + if (LastY > HeightY) + { + HeightY = LastY; + } break; } } // switch (GetBlock) } // for y - cChunkDef::SetHeight(a_HeightMap, x, z, LastY); + cChunkDef::SetHeight(a_HeightMap, x, z, HeightY); } // for x } // for z } @@ -525,7 +536,7 @@ void cFinishGenPreSimulator::StationarizeFluid( // Turn fluid at the chunk edges into non-stationary fluid: for (int y = 0; y < cChunkDef::Height; y++) { - for (int i = 1; i < cChunkDef::Width; i++) // i stands for both x and z here + for (int i = 0; i < cChunkDef::Width; i++) // i stands for both x and z here { if (cChunkDef::GetBlock(a_BlockTypes, 0, y, i) == a_StationaryFluid) { |