From ff5b485dbca39e0865a54a186f871fa475a6b944 Mon Sep 17 00:00:00 2001 From: maxicarlos08 Date: Fri, 20 Oct 2023 00:04:16 +0200 Subject: [PATCH] fix panic in /reload_chunks if the terrain persistence feature was enabled but disabled in the settings --- server/src/cmd.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/src/cmd.rs b/server/src/cmd.rs index f5b1093a93..d9dc3575e2 100644 --- a/server/src/cmd.rs +++ b/server/src/cmd.rs @@ -3493,8 +3493,8 @@ fn handle_reload_chunks( server .state .ecs() - .write_resource::() - .unload_all(); + .try_fetch_mut::() + .map(|mut terrain_persistence| terrain_persistence.unload_all()); server.state.clear_terrain(); Ok(())