|
@@ -98,10 +98,12 @@ bool ChunkFluidModel::isPartOfGroundModel(
|
|
else
|
|
else
|
|
{
|
|
{
|
|
int naighborIndex = Chunk::index(neighborLocation);
|
|
int naighborIndex = Chunk::index(neighborLocation);
|
|
- if (!blocks()[naighborIndex]
|
|
|
|
- || !blocks()[naighborIndex]
|
|
|
|
- ->zBlockType()
|
|
|
|
- ->isFluid())
|
|
|
|
|
|
+ int currIndex = Chunk::index(location);
|
|
|
|
+ if (!blocks()[naighborIndex] || !isPartOfModel(blocks()[naighborIndex])
|
|
|
|
+ || blocks()[currIndex]->zBlockType()
|
|
|
|
+ != blocks()[naighborIndex]->zBlockType()
|
|
|
|
+ || blocks()[naighborIndex]->getDistanceToSource()
|
|
|
|
+ > blocks()[currIndex]->getDistanceToSource())
|
|
{
|
|
{
|
|
needed = 1;
|
|
needed = 1;
|
|
}
|
|
}
|
|
@@ -139,6 +141,14 @@ void ChunkFluidModel::buildModel()
|
|
(i / WORLD_HEIGHT) / CHUNK_SIZE,
|
|
(i / WORLD_HEIGHT) / CHUNK_SIZE,
|
|
(i / WORLD_HEIGHT) % CHUNK_SIZE,
|
|
(i / WORLD_HEIGHT) % CHUNK_SIZE,
|
|
i % WORLD_HEIGHT);
|
|
i % WORLD_HEIGHT);
|
|
|
|
+ Framework::Vec3<int> aboveLocation
|
|
|
|
+ = location
|
|
|
|
+ + getDirection(Direction::TOP);
|
|
|
|
+ int aboveIndex = Chunk::index(aboveLocation);
|
|
|
|
+ bool sameAbove = aboveLocation.z < WORLD_HEIGHT
|
|
|
|
+ && blocks()[aboveIndex]
|
|
|
|
+ && blocks()[aboveIndex]->zBlockType()
|
|
|
|
+ == blocks()[i]->zBlockType();
|
|
if (isPartOfGroundModel(location, index))
|
|
if (isPartOfGroundModel(location, index))
|
|
{
|
|
{
|
|
if (!groundModelBuidler.get(
|
|
if (!groundModelBuidler.get(
|
|
@@ -196,7 +206,8 @@ void ChunkFluidModel::buildModel()
|
|
= groundVertexCount;
|
|
= groundVertexCount;
|
|
groundVerticies[groundVertexCount++]
|
|
groundVerticies[groundVertexCount++]
|
|
= vBuffer[polygon->indexList[vi]];
|
|
= vBuffer[polygon->indexList[vi]];
|
|
- if (groundVerticies[groundVertexCount - 1].pos.z > 0)
|
|
|
|
|
|
+ if (groundVerticies[groundVertexCount - 1].pos.z > 0
|
|
|
|
+ && !sameAbove)
|
|
{
|
|
{
|
|
char maxFlowDist = blocks()[i]
|
|
char maxFlowDist = blocks()[i]
|
|
->zBlockType()
|
|
->zBlockType()
|