impl/mesh: generate_voxel_physics_boxes(): Throw on undefined voxel

This commit is contained in:
Perttu Ahola 2014-10-19 17:49:40 +03:00
parent 3e84167b94
commit fea7208fa0

View File

@ -844,6 +844,8 @@ void generate_voxel_physics_boxes(
VoxelInstance v_orig = volume_orig.getVoxelAt(x, y, z); VoxelInstance v_orig = volume_orig.getVoxelAt(x, y, z);
const interface::CachedVoxelDefinition *def = const interface::CachedVoxelDefinition *def =
voxel_reg->get_cached(v_orig); voxel_reg->get_cached(v_orig);
if(!def)
throw Exception(ss_()+"Undefined voxel: "+itos(v_orig.getId()));
uint8_t v = (def && def->physically_solid); uint8_t v = (def && def->physically_solid);
volume.setVoxelAt(x, y, z, v); volume.setVoxelAt(x, y, z, v);
} }