Skip to content

Commit

Permalink
Const correctness
Browse files Browse the repository at this point in the history
  • Loading branch information
numberZero authored and rubenwardy committed Feb 22, 2024
1 parent 34286d7 commit 2f35b12
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/client/content_mapblock.cpp
Expand Up @@ -617,14 +617,14 @@ void MapblockMeshGenerator::calculateCornerLevels()
cur_liquid.corner_levels[k][i] = getCornerLevel(i, k);
}

f32 MapblockMeshGenerator::getCornerLevel(int i, int k)
f32 MapblockMeshGenerator::getCornerLevel(int i, int k) const
{
float sum = 0;
int count = 0;
int air_count = 0;
for (int dk = 0; dk < 2; dk++)
for (int di = 0; di < 2; di++) {
LiquidData::NeighborData &neighbor_data = cur_liquid.neighbors[k + dk][i + di];
const LiquidData::NeighborData &neighbor_data = cur_liquid.neighbors[k + dk][i + di];
content_t content = neighbor_data.content;

// If top is liquid, draw starting from top of node
Expand Down
2 changes: 1 addition & 1 deletion src/client/content_mapblock.h
Expand Up @@ -138,7 +138,7 @@ class MapblockMeshGenerator
void prepareLiquidNodeDrawing();
void getLiquidNeighborhood();
void calculateCornerLevels();
f32 getCornerLevel(int i, int k);
f32 getCornerLevel(int i, int k) const;
void drawLiquidSides();
void drawLiquidTop();
void drawLiquidBottom();
Expand Down

0 comments on commit 2f35b12

Please sign in to comment.