add 'blocking' entity property

This commit is contained in:
MihailRis
2024-07-10 04:56:02 +03:00
parent 60f4f33180
commit e0358fe2db
6 changed files with 19 additions and 4 deletions
+4 -3
View File
@@ -405,9 +405,10 @@ void PlayerController::processRightClick(Block* def, Block* target) {
}
blockid_t chosenBlock = def->rt.id;
auto hitbox = player->getHitbox();
if (hitbox && def->obstacle && level->physics->isBlockInside(
coord.x, coord.y, coord.z, def,state, hitbox)) {
AABB blockAABB(coord, coord+1);
bool blocked = level->entities->hasBlockingInside(blockAABB);
if (def->obstacle && blocked) {
return;
}
auto vox = chunks->get(coord);