summaryrefslogtreecommitdiffhomepage
path: root/serialize
diff options
context:
space:
mode:
Diffstat (limited to 'serialize')
-rw-r--r--serialize/world-impl.hpp3
-rw-r--r--serialize/world-reader.cpp4
2 files changed, 5 insertions, 2 deletions
diff --git a/serialize/world-impl.hpp b/serialize/world-impl.hpp
index f01276be..df0657ce 100644
--- a/serialize/world-impl.hpp
+++ b/serialize/world-impl.hpp
@@ -29,6 +29,7 @@
* 14) Always store object offset, rework how sc_exact works.
* 15) Add light alpha.
* 16) One more bit for light falloff enum.
+ * 17) Switch critter::offset_frac to unsigned.
*/
namespace floormat {
@@ -49,7 +50,7 @@ template<typename T> constexpr inline T int_max = std::numeric_limits<T>::max();
#define file_magic ".floormat.save"
-constexpr inline proto_t proto_version = 16;
+constexpr inline proto_t proto_version = 17;
constexpr inline size_t atlas_name_max = 128;
constexpr inline auto null_atlas = (atlasid)-1LL;
diff --git a/serialize/world-reader.cpp b/serialize/world-reader.cpp
index 53b675ea..b912b5d7 100644
--- a/serialize/world-reader.cpp
+++ b/serialize/world-reader.cpp
@@ -268,9 +268,11 @@ void reader_state::read_chunks(reader_t& s)
proto.frame = s.read<uint8_t>();
else
proto.frame << s;
- Vector2s offset_frac;
+ Vector2us offset_frac;
offset_frac[0] << s;
offset_frac[1] << s;
+ if (PROTO < 17) [[unlikely]]
+ offset_frac = {};
const bool exact = id & meta_short_scenery_bit;
SET_CHUNK_SIZE();