From aa5089b36453026ad33ce3cc3c11210774a45c84 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 10 Jun 2023 19:17:21 +0200 Subject: wip --- serialize/world-reader.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'serialize/world-reader.cpp') diff --git a/serialize/world-reader.cpp b/serialize/world-reader.cpp index c6b23999..f1492161 100644 --- a/serialize/world-reader.cpp +++ b/serialize/world-reader.cpp @@ -338,8 +338,17 @@ void reader_state::read_chunks(reader_t& s) uint8_t flags; flags << s; const bool exact = flags & 1; proto.r = rotation((flags >> 1) & lowbits); - proto.falloff = light_falloff((flags >> 4) & lowbits); - const bool enabled = (flags >> 6) & 1; + bool enabled; + if (PROTO >= 16) [[likely]] + { + proto.falloff = light_falloff((flags >> 4) & lowbits); + enabled = (flags >> 7) & 1; + } + else + { + proto.falloff = light_falloff((flags >> 4) & lowbits<2>); + enabled = (flags >> 6) & 1; + } s >> proto.max_distance; for (auto i = 0uz; i < 3; i++) -- cgit v1.2.3