From 436cbfd415b19b7f41c49eda466f16a6860de45e Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 18 Mar 2023 00:50:41 +0100 Subject: a --- serialize/world-reader.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/serialize/world-reader.cpp b/serialize/world-reader.cpp index b79a1122..78e7e539 100644 --- a/serialize/world-reader.cpp +++ b/serialize/world-reader.cpp @@ -302,16 +302,16 @@ void reader_state::deserialize_world(ArrayView buf) fm_throw("bad proto version '{}' (should be between '{}' and '{}')"_cf, (std::size_t)proto, (std::size_t)min_proto_version, (std::size_t)proto_version); PROTO = proto; + std::uint64_t entity_counter = 0; + if (PROTO >= 8) [[likely]] + entity_counter << s; read_atlases(s); - if (PROTO >= 3) + if (PROTO >= 3) [[likely]] read_sceneries(s); read_chunks(s); - if (PROTO >= 8) - { - fm_assert(_world->entity_counter() == 0); - _world->set_entity_counter(s.read()); - } s.assert_end(); + fm_assert(_world->entity_counter() == 0); + _world->set_entity_counter(entity_counter); _world = nullptr; } -- cgit v1.2.3