From ec5287ca8618fe108fd0069012e1e14bd8d224e5 Mon Sep 17 00:00:00 2001 From: popertots Date: Sat, 21 Mar 2026 14:25:28 +0000 Subject: [PATCH] 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. --- config.toml | 2 +- src/entities/livestock/rabbit.rs | 4 ++++ src/world/tiles/visibility.rs | 13 ++++++++++--- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/config.toml b/config.toml index d96bbfc..356bfbd 100644 --- a/config.toml +++ b/config.toml @@ -6,4 +6,4 @@ vsync = "mailbox" [spawn_counts] dorfs = 50 pigs = 5 -rabbits = 5 \ No newline at end of file +rabbits = 15 \ No newline at end of file diff --git a/src/entities/livestock/rabbit.rs b/src/entities/livestock/rabbit.rs index 521e311..211e4f2 100644 --- a/src/entities/livestock/rabbit.rs +++ b/src/entities/livestock/rabbit.rs @@ -117,6 +117,10 @@ pub fn rabbit_dig_system( time: Res