diff --git a/VERSION b/VERSION index 09a3acfa..7ceb0404 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.6.0 \ No newline at end of file +0.6.1 \ No newline at end of file diff --git a/egregoria/src/lib.rs b/egregoria/src/lib.rs index 965972bd..bfc44b08 100644 --- a/egregoria/src/lib.rs +++ b/egregoria/src/lib.rs @@ -59,7 +59,6 @@ use crate::transportation::train::RailWagon; use crate::utils::scheduler::RunnableSystem; use crate::utils::time::Tick; use common::FastMap; -use serde::de::Error; pub use utils::par_command_buffer::ParCommandBuffer; pub use utils::config::*; @@ -410,11 +409,17 @@ impl<'de> Deserialize<'de> for Egregoria { t.elapsed().as_secs_f32() ); - if goriadeser.version != VERSION { - return Err(Error::custom(format!( - "couldn't load save, incompatible version! save is: {} - game is: {}", - goriadeser.version, VERSION - ))); + let cur_version_parts = VERSION.split('.').collect::>(); + let deser_parts = goriadeser.version.split('.').collect::>(); + + if cur_version_parts[0] != deser_parts[0] + || (cur_version_parts[0] == "0" && cur_version_parts[1] != deser_parts[1]) + { + log::warn!( + "incompatible version, save might be corrupted! save is: {} - game is: {}", + goriadeser.version, + VERSION + ); } let mut goria = Self {