mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
fix extended block grounding (new block property)
This commit is contained in:
parent
0cc8c70a17
commit
0b7dc14f55
7 changed files with 111 additions and 8 deletions
|
|
@ -106,10 +106,17 @@ void BlocksController::updateBlock(int x, int y, int z) {
|
|||
if (vox == nullptr) return;
|
||||
const auto& def = level.content.getIndices()->blocks.require(vox->id);
|
||||
if (def.grounded) {
|
||||
const auto& vec = get_ground_direction(def, vox->state.rotation);
|
||||
if (!blocks_agent::is_solid_at(chunks, x + vec.x, y + vec.y, z + vec.z)) {
|
||||
breakBlock(nullptr, def, x, y, z);
|
||||
return;
|
||||
if (def.rt.extended) {
|
||||
auto origin = blocks_agent::seek_origin(chunks, {x, y, z}, def, vox->state);
|
||||
if (!blocks_agent::check_grounding(chunks, def, vox->state.rotation, origin)) {
|
||||
breakBlock(nullptr, def, origin.x, origin.y, origin.z);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (!blocks_agent::check_grounding(chunks, def, vox->state.rotation, {x, y, z})) {
|
||||
breakBlock(nullptr, def, x, y, z);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (def.rt.funcsset.update) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue