mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
only attempt to remove empty terrain file if it exists
This commit is contained in:
parent
5e8de39fd0
commit
59b176a7bb
@ -169,9 +169,11 @@ impl TerrainPersistence {
|
||||
if chunk.blocks.is_empty() {
|
||||
let path = self.path_for(key);
|
||||
|
||||
if path.is_file() {
|
||||
if let Err(error) = std::fs::remove_file(&path) {
|
||||
error!(?error, ?path, "Failed to remove file for empty chunk");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
let bytes = match bincode::serialize::<version::Current>(&chunk.prepare_raw()) {
|
||||
Err(err) => {
|
||||
|
Loading…
Reference in New Issue
Block a user