mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 16:45:20 +02:00
Fixed viewing range stuff a bit (now it works better with very low ranges)
This commit is contained in:
@@ -184,6 +184,10 @@ bool isBlockInSight(v3s16 blockpos_b, v3f camera_pos, v3f camera_dir, f32 range,
|
||||
if(distance_ptr)
|
||||
*distance_ptr = d;
|
||||
|
||||
// If block is very close, it is always in sight
|
||||
if(d < 1.44*1.44*MAP_BLOCKSIZE*BS/2)
|
||||
return true;
|
||||
|
||||
// If block is far away, it's not in sight
|
||||
if(d > range * BS)
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user