summaryrefslogtreecommitdiffhomepage
path: root/serialize
diff options
context:
space:
mode:
Diffstat (limited to 'serialize')
-rw-r--r--serialize/world-impl.hpp2
-rw-r--r--serialize/world-reader.cpp7
2 files changed, 7 insertions, 2 deletions
diff --git a/serialize/world-impl.hpp b/serialize/world-impl.hpp
index e74ebda2..59c57e78 100644
--- a/serialize/world-impl.hpp
+++ b/serialize/world-impl.hpp
@@ -33,7 +33,7 @@ template<typename T> constexpr inline T int_max = std::numeric_limits<T>::max();
constexpr inline std::size_t atlas_name_max = 128;
constexpr inline auto null_atlas = (atlasid)-1LL;
-constexpr inline proto_t proto_version = 3;
+constexpr inline proto_t proto_version = 4;
constexpr inline proto_t min_proto_version = 1;
constexpr inline auto chunk_magic = (std::uint16_t)~0xc0d3;
constexpr inline auto scenery_magic = (std::uint16_t)~0xb00b;
diff --git a/serialize/world-reader.cpp b/serialize/world-reader.cpp
index f5459203..4d27c27f 100644
--- a/serialize/world-reader.cpp
+++ b/serialize/world-reader.cpp
@@ -173,7 +173,12 @@ void reader_state::read_chunks(reader_t& s)
else
sc.frame.frame << s;
if (sc.frame.active)
- sc.frame.delta << s;
+ {
+ if (PROTO >= 4) [[likely]]
+ sc.frame.delta << s;
+ else
+ sc.frame.delta = (std::uint16_t)Math::clamp(int(s.read<float>() * 65535), 0, 65535);
+ }
}
t.scenery() = sc;
}