Ejemplo n.º 1
0
/**
 * Set the ground fences of a voxel stack.
 * @param fences Ground fences to set.
 * @param stack The voxel stack to assign to.
 * @param base_z Height of the base voxel.
 */
void AddGroundFencesToMap(uint16 fences, VoxelStack *stack, int base_z)
{
	Voxel *v = stack->GetCreate(base_z, false); // It should have ground at least.
	assert(v->GetGroundType() != GTP_INVALID);
	uint8 slope = v->GetGroundSlope();

	v->SetFences(MergeGroundFencesAtBase(v->GetFences(), fences, slope));
	v = stack->GetCreate(base_z + 1, HasTopVoxelFences(slope));
	if (v != nullptr) v->SetFences(MergeGroundFencesAtTop(v->GetFences(), fences, slope));
}