Immersive Vehicles (Formerly Transport Simulator)

Immersive Vehicles (Formerly Transport Simulator)

4M Downloads

[BUG] `ground_distance` (and I assume `terrain_distance`) seems to account for blocks above the entity

boot2big opened this issue ยท 3 comments

commented

At first I thought this was intentional, as more of an altitude-based variable. But I read up on both definitions and neither seem to fit this definition, and should therefore only be checking for blocks under the device, not above it.
Particularly problematic if you have a device that does maths based on ground/terrain distance, since this reports a negative number up until the block above the obstruction (I presume)
image
(Modified the screen instrument to display ground_distance_1)

Expected behavior would be... I'm under a bridge or in a tunnel, and the ground device doesn't report back to me that it's anywhere between -7 to -40 blocks above the terrain. What!?

commented

that is a genuinely interesting issue, considering ground_distance would normally be used on an aircraft something like this would never be really noticed unless youre flying under tunnels or something.

commented

I would assume that's part of where this issue stems from, though ideally I would say we should scan for terrain below the entity running terrain_distance or ground_distance_x, as we have no real use for know what terrain is above the object, and for such usecases that somebody could come up with, you could probably solve them by just using the sunlight variable or having a dedicated sky_visible variable. Or something.

commented

Fixed in V22.6.0.