Skip to content

Commit 5c0c0e1

Browse files
committed
Rebase fixes
1 parent 9ce9b69 commit 5c0c0e1

1 file changed

Lines changed: 19 additions & 3 deletions

File tree

src/CommonLib/Planet.cpp

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,23 @@ namespace tsom
169169
}
170170
}
171171

172-
if (neighborMask != 0)
172+
DirectionMask directionMask;
173+
if (indices.x == 0)
174+
directionMask |= Direction::Left;
175+
else if (indices.x == size.x - 1)
176+
directionMask |= Direction::Right;
177+
178+
if (indices.y == 0)
179+
directionMask |= Direction::Front;
180+
else if (indices.y == size.y - 1)
181+
directionMask |= Direction::Back;
182+
183+
if (indices.z == 0)
184+
directionMask |= Direction::Down;
185+
else if (indices.z == size.z - 1)
186+
directionMask |= Direction::Up;
187+
188+
if (directionMask != 0)
173189
{
174190
auto& previousBlockData = blockLibrary.GetBlockData(oldBlock);
175191
auto& newBlockData = blockLibrary.GetBlockData(newBlock);
@@ -183,7 +199,7 @@ namespace tsom
183199
if (previousBlockData.isTransparent)
184200
{
185201
// We're putting an opaque block on a transparent one
186-
for (Direction direction : neighborMask)
202+
for (Direction direction : directionMask)
187203
{
188204
NazaraAssert(chunkData.directionHoleCount[direction] > 0);
189205
if (--chunkData.directionHoleCount[direction] == 0)
@@ -193,7 +209,7 @@ namespace tsom
193209
else
194210
{
195211
// Replacing an opaque block by a transparent one
196-
for (Direction direction : neighborMask)
212+
for (Direction direction : directionMask)
197213
{
198214
chunkData.directionHoleCount[direction]++;
199215
chunkData.visibilityMask |= direction;

0 commit comments

Comments
 (0)