fix: loaded-chunk guard in calculate_visibility, reset dig timer while airborne

- calculate_visibility: None from floor_tiles.get() now checks tilemap.chunks
  to confirm the neighbour's chunk is loaded before treating it as air.
  Without this, unloaded world borders and pending chunks were incorrectly
  seen as open space, causing underground tiles to render as black.
- rabbit_dig_system: skip and reset timer when entity is not on standable
  ground, preventing rapid-dig cascade as rabbit falls through multiple levels.
This commit is contained in:
2026-03-21 14:25:28 +00:00
parent 36f068bf0c
commit ec5287ca86
3 changed files with 15 additions and 4 deletions
+4
View File
@@ -117,6 +117,10 @@ pub fn rabbit_dig_system(
time: Res<Time>,
) {
for (transform, mut dig_timer) in query.iter_mut() {
if !tilemap.is_standable(transform.translation.as_ivec3()) {
dig_timer.secs_remaining = DIG_INTERVAL_SECS;
continue;
}
dig_timer.secs_remaining -= time.delta_secs();
if dig_timer.secs_remaining > 0.0 {
continue;