Merge branch 'main' into entities

This commit is contained in:
MihailRis
2024-07-10 09:25:56 +03:00
4 changed files with 21 additions and 5 deletions
+6 -3
View File
@@ -84,9 +84,12 @@ void BlocksController::updateBlock(int x, int y, int z) {
if (vox == nullptr)
return;
auto def = level->content->getIndices()->blocks.get(vox->id);
if (def->grounded && !chunks->isSolidBlock(x, y-1, z)) {
breakBlock(nullptr, def, x, y, z);
return;
if (def->grounded) {
const auto& vec = get_ground_direction(def, vox->state.rotation);
if (!chunks->isSolidBlock(x+vec.x, y+vec.y, z+vec.z)) {
breakBlock(nullptr, def, x, y, z);
return;
}
}
if (def->rt.funcsset.update) {
scripting::update_block(def, x, y, z);