Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Zylann committed Apr 30, 2023
1 parent 4f6ca6f commit 1caf106
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ bool ZN_FastNoiseLiteEditorInspectorPlugin::_zn_can_handle(const Object *p_objec

void ZN_FastNoiseLiteEditorInspectorPlugin::_zn_parse_begin(Object *p_object) {
const ZN_FastNoiseLite *noise_ptr = Object::cast_to<ZN_FastNoiseLite>(p_object);
if (noise_ptr) {
if (noise_ptr != nullptr) {
Ref<ZN_FastNoiseLite> noise(noise_ptr);

ZN_FastNoiseLiteViewer *viewer = memnew(ZN_FastNoiseLiteViewer);
Expand All @@ -20,7 +20,7 @@ void ZN_FastNoiseLiteEditorInspectorPlugin::_zn_parse_begin(Object *p_object) {
return;
}
const ZN_FastNoiseLiteGradient *noise_gradient_ptr = Object::cast_to<ZN_FastNoiseLiteGradient>(p_object);
if (noise_gradient_ptr) {
if (noise_gradient_ptr != nullptr) {
Ref<ZN_FastNoiseLiteGradient> noise_gradient(noise_gradient_ptr);

ZN_FastNoiseLiteViewer *viewer = memnew(ZN_FastNoiseLiteViewer);
Expand Down
18 changes: 8 additions & 10 deletions terrain/fixed_lod/voxel_terrain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1373,11 +1373,10 @@ void VoxelTerrain::apply_data_block_response(VoxelEngine::BlockDataOutput &ob) {
return;
}

_data->try_set_block(
block_pos, block, [](VoxelDataBlock &existing_block, const VoxelDataBlock &incoming_block) {
existing_block.set_voxels(incoming_block.get_voxels_shared());
existing_block.set_edited(incoming_block.is_edited());
});
_data->try_set_block(block_pos, block, [](VoxelDataBlock &existing_block, const VoxelDataBlock &incoming_block) {
existing_block.set_voxels(incoming_block.get_voxels_shared());
existing_block.set_edited(incoming_block.is_edited());
});

emit_data_block_loaded(block_pos);

Expand Down Expand Up @@ -1444,11 +1443,10 @@ bool VoxelTerrain::try_set_block_data(Vector3i position, std::shared_ptr<VoxelBu
block.viewers = refcount;

// Create or update block data
_data->try_set_block(
position, block, [](VoxelDataBlock &existing_block, const VoxelDataBlock &incoming_block) {
existing_block.set_voxels(incoming_block.get_voxels_shared());
existing_block.set_edited(incoming_block.is_edited());
});
_data->try_set_block(position, block, [](VoxelDataBlock &existing_block, const VoxelDataBlock &incoming_block) {
existing_block.set_voxels(incoming_block.get_voxels_shared());
existing_block.set_edited(incoming_block.is_edited());
});

// The block itself might not be suitable for meshing yet, but blocks surrounding it might be now
try_schedule_mesh_update_from_data(
Expand Down

0 comments on commit 1caf106

Please sign in to comment.