Skip to content

Commit

Permalink
Fix iterator bug
Browse files Browse the repository at this point in the history
  • Loading branch information
nhatdongdang committed Aug 12, 2024
1 parent 978a4fe commit 2d99dd6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/mcpp/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ struct Chunk {
};

Iterator begin() { return Iterator(&raw_data[0]); }
Iterator end() { return Iterator(&raw_data[_x_len * _z_len * _z_len]); }
Iterator end() { return Iterator(&raw_data[_x_len * _y_len * _z_len]); }

/**
* Initialized by copying from a flat vector of blocks
Expand Down
2 changes: 1 addition & 1 deletion test/minecraft_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ TEST_CASE("getBlocks and Chunk operations") {
for (BlockType block : res) {
expected_blocks.push_back(block);
}
CHECK_NE(blocks, expected_blocks);
CHECK_EQ(blocks, expected_blocks);
}

mc.setBlock(test_loc, BlockType(0));
Expand Down

0 comments on commit 2d99dd6

Please sign in to comment.