Merge branch 'crabman/reload-chunks-fix' into 'master'

Fix panic in /reload_chunks if the terrain persistence feature was enabled but disabled in the server settings

See merge request veloren/veloren!4150
This commit is contained in:
Imbris 2023-10-19 22:45:25 +00:00
commit 306be0f9ba

View File

@ -3493,8 +3493,8 @@ fn handle_reload_chunks(
server
.state
.ecs()
.write_resource::<crate::terrain_persistence::TerrainPersistence>()
.unload_all();
.try_fetch_mut::<crate::terrain_persistence::TerrainPersistence>()
.map(|mut terrain_persistence| terrain_persistence.unload_all());
server.state.clear_terrain();
Ok(())