mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
add 'blocking' entity property
This commit is contained in:
parent
60f4f33180
commit
e0358fe2db
6 changed files with 19 additions and 4 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue