Fix ZS noclip detection with custom blocks

This commit is contained in:
UnknownShadow200 2017-02-15 11:27:24 +11:00
parent 479e9f149f
commit a4a40685d8

View File

@ -119,10 +119,10 @@ namespace MCGalaxy {
baseBB = Block.BlockAABB(block, extBlock, lvl);
baseBB = baseBB.Offset(-16, 0, -16); // centre around [-16, 16] instead of [0, 32]
baseBB = baseBB.Expand(-1); // adjust the block inwards slightly
} else {
baseBB = AABB.Make(new Vec3S32(0, 0, 0), BaseSize(model));
}
baseBB = baseBB.Expand(-1); // adjust the model AABB inwards slightly
float scale;
if (!Utils.TryParseDecimal(scaleStr, out scale)) return baseBB;
@ -159,12 +159,13 @@ namespace MCGalaxy {
.Offset(x * 32, y * 32, z * 32);
if (!bb.Intersects(blockBB)) continue;
if (block == Block.custom_block) {
if (!Block.Walkthrough(Block.Convert(block))) return true;
if (block != Block.custom_block) continue;
} else {
BlockDefinition def = lvl.CustomBlockDefs[extBlock];
if (def == null || def.CollideType == CollideType.Solid) return true;
}
}
return false;
}
}