Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/renderer.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1010,6 +1010,7 @@ pub const MeshSelection = struct { // MARK: MeshSelection
const neighborBlock = block;
oldBlock = mesh_storage.getBlockFromRenderThread(neighborPos[0], neighborPos[1], neighborPos[2]) orelse return;
block = oldBlock;
// Check if the neighbor block has a block and that it is the same type as the placed item
Copy link
Member

@IntegratedQuantum IntegratedQuantum Nov 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first part "Check if the neighbor block has a block" makes no sense, what does it mean for a block to have a block???
And the second part "that it is the same type as the placed item" is just describing the code, and in my opinion is not more or less readable than block.typ == itemBlock. If you think this part is unclear then a better choice would be to use a more descriptive variable name instead of a comment.

So overall in my opinion this comment, in its current state, makes the code more confusing than before.

if(block.typ == itemBlock) {
if(rotationMode.generateData(main.game.world.?, neighborPos, relPos, lastDir, neighborDir, neighborOfSelection, &block, neighborBlock, false)) {
if(!canPlaceBlock(neighborPos, block)) return;
Expand Down