Only connect fences to full blocks

Also removed some debug code.

fixes #814
This commit is contained in:
IntegratedQuantum 2024-12-07 14:59:47 +01:00
parent 8a097804ab
commit 0d56992c22
2 changed files with 1 additions and 12 deletions

View File

@ -250,7 +250,7 @@ pub const RotationModes = struct {
const blockBaseModel = blocks.meshes.modelIndexStart(block.*);
const neighborBaseModel = blocks.meshes.modelIndexStart(neighborBlock);
const neighborModel = blocks.meshes.model(neighborBlock);
const targetVal = neighborBlock.solid() and (blockBaseModel == neighborBaseModel or main.models.models.items[neighborModel].neighborFacingQuads[neighbor.reverse().toInt()].len != 0);
const targetVal = neighborBlock.solid() and (blockBaseModel == neighborBaseModel or main.models.models.items[neighborModel].isNeighborOccluded[neighbor.reverse().toInt()]);
var currentData: FenceData = @bitCast(@as(u4, @truncate(block.data)));
switch(neighbor) {
.dirNegX => {

View File

@ -68,17 +68,6 @@ pub const StructureMapFragment = struct {
}
pub fn deinit(self: *StructureMapFragment) void {
var actual: usize = 0;
for(self.data) |i| {
actual += i.len*@sizeOf(StructureInternal);
}
var expected: usize = 0;
var it = self.arena.arena.state.buffer_list.first;
while(it) |node| {
expected += node.data;
it = node.next;
}
std.log.err("{} {}", .{expected, actual});
self.arena.deinit();
main.globalAllocator.destroy(self);
}