]> git.localhorst.tv Git - blank.git/blobdiff - src/rand/GaloisLFSR.hpp
group entity updates in as few packets as possible
[blank.git] / src / rand / GaloisLFSR.hpp
index 395ff8f0546cc7b75cf111a4b996a7705052f29b..b0714432c77eb20e8cdeff74d6b2ce7dc7220f43 100644 (file)
@@ -12,7 +12,11 @@ class GaloisLFSR {
 public:
        // seed should be non-zero
        explicit GaloisLFSR(std::uint64_t seed) noexcept
-       : state(seed) { }
+       : state(seed) {
+               if (state == 0) {
+                       state = 1;
+               }
+       }
 
        // get the next bit
        bool operator ()() noexcept {