Skip to content

Commit

Permalink
Fixed #56.
Browse files Browse the repository at this point in the history
  • Loading branch information
Unarelith committed Mar 15, 2020
1 parent a95cd77 commit 8d60cb5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion client/source/world/ChunkBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,17 @@ inline void ChunkBuilder::addFace(s8f x, s8f y, s8f z, s8f f, const ClientChunk
vertices[v].coord3d[2] = z + vertexPos[v]->z - boundingBox.z * normal.z;
}
else {
float blockHeight = vertexPos[v]->z;
if (block.drawType() == BlockDrawType::Liquid && (!surroundingBlock || !surroundingBlock->id())) {
if (f == BlockFace::Bottom)
blockHeight = vertexPos[v]->z - 2.f / 16.f;
else
blockHeight = vertexPos[v]->z * 14.f / 16.f;
}

vertices[v].coord3d[0] = x + vertexPos[v]->x;
vertices[v].coord3d[1] = y + vertexPos[v]->y;
vertices[v].coord3d[2] = z + vertexPos[v]->z;
vertices[v].coord3d[2] = z + blockHeight;
}

vertices[v].coord3d[3] = f;
Expand Down

0 comments on commit 8d60cb5

Please sign in to comment.