mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2025-02-11 10:30:06 +01:00
Handle a missing case when setting voxels in TerrainWorld.
This commit is contained in:
parent
39cb3e398f
commit
39b3a12b1a
@ -818,6 +818,15 @@ void TerrainWorld::set_voxel_at_world_position(const Vector3 &world_position, co
|
||||
chunk->build();
|
||||
}
|
||||
}
|
||||
|
||||
if (bx == 0 && bz == 0) {
|
||||
Ref<TerrainChunk> chunk = chunk_get_or_create(x - 1, z - 1);
|
||||
chunk->set_voxel(data, get_chunk_size_x(), get_chunk_size_z(), channel_index);
|
||||
|
||||
if (rebuild) {
|
||||
chunk->build();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (get_data_margin_start() > 0) {
|
||||
@ -958,6 +967,24 @@ void TerrainWorld::set_voxel_at_world_data_position(const Vector2i &world_data_p
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (bx == 0 && bz == 0) {
|
||||
if (allow_creating_chunks) {
|
||||
chunk = chunk_get_or_create(x - 1, z - 1);
|
||||
} else {
|
||||
chunk = chunk_get(x - 1, z - 1);
|
||||
}
|
||||
|
||||
if (chunk.is_valid()) {
|
||||
chunk->set_voxel(data, get_chunk_size_x(), get_chunk_size_z(), channel_index);
|
||||
|
||||
if (p_immediate_build) {
|
||||
chunk->build_immediate();
|
||||
} else {
|
||||
chunk->build();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (get_data_margin_start() > 0) {
|
||||
@ -1095,6 +1122,20 @@ void TerrainWorld::set_voxels_at_world_data_position(const Array &p_data, const
|
||||
chunks_to_rebuild.insert(chunk);
|
||||
}
|
||||
}
|
||||
|
||||
if (bx == 0 && bz == 0) {
|
||||
if (p_allow_creating_chunks) {
|
||||
chunk = chunk_get_or_create(x - 1, z - 1);
|
||||
} else {
|
||||
chunk = chunk_get(x - 1, z - 1);
|
||||
}
|
||||
|
||||
if (chunk.is_valid()) {
|
||||
chunk->set_voxel(value, get_chunk_size_x(), get_chunk_size_z(), p_channel_index);
|
||||
|
||||
chunks_to_rebuild.insert(chunk);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (get_data_margin_start() > 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user