placing non-obstacle blocks

This commit is contained in:
A-lex-Ra
2023-12-11 15:24:36 +06:00
parent a229513ff7
commit 3ae3001227
+2 -1
View File
@@ -257,7 +257,8 @@ void PlayerController::updateInteraction(){
} }
vox = chunks->get(x, y, z); vox = chunks->get(x, y, z);
if (vox && (block = contentIds->getBlockDef(vox->id))->replaceable) { if (vox && (block = contentIds->getBlockDef(vox->id))->replaceable) {
if (!level->physics->isBlockInside(x,y,z, player->hitbox)){ if (!level->physics->isBlockInside(x,y,z, player->hitbox)
|| !def->obstacle){
chunks->set(x, y, z, player->choosenBlock, states); chunks->set(x, y, z, player->choosenBlock, states);
lighting->onBlockSet(x,y,z, player->choosenBlock); lighting->onBlockSet(x,y,z, player->choosenBlock);
} }