Const correctness

This commit is contained in:
numzero 2023-06-17 10:37:01 +03:00 committed by rubenwardy
parent 34286d77c7
commit 2f35b121a4
2 changed files with 3 additions and 3 deletions

@ -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

@ -138,7 +138,7 @@ private:
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();