summaryrefslogtreecommitdiffhomepage
path: root/serialize/world-reader.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-06-10 19:17:21 +0200
committerStanislaw Halik <sthalik@misaki.pl>2023-06-10 19:17:21 +0200
commitaa5089b36453026ad33ce3cc3c11210774a45c84 (patch)
treefd54a9c53ea957d5dd34c746de1c7e09afae73a3 /serialize/world-reader.cpp
parenta0152f2c253dbf3c2c23d83a261d89e97310b430 (diff)
wip
Diffstat (limited to 'serialize/world-reader.cpp')
-rw-r--r--serialize/world-reader.cpp13
1 files changed, 11 insertions, 2 deletions
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<rotation_BITS>);
- proto.falloff = light_falloff((flags >> 4) & lowbits<light_falloff_BITS>);
- const bool enabled = (flags >> 6) & 1;
+ bool enabled;
+ if (PROTO >= 16) [[likely]]
+ {
+ proto.falloff = light_falloff((flags >> 4) & lowbits<light_falloff_BITS>);
+ 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++)