Commit 9273069d authored by nanahira's avatar nanahira

fix all zero seed

parent a5dce932
...@@ -130,8 +130,18 @@ int main(int argc, char* argv[]) { ...@@ -130,8 +130,18 @@ int main(int argc, char* argv[]) {
reinterpret_cast<unsigned char*>(ygo::pre_seed[i - 13]), reinterpret_cast<unsigned char*>(ygo::pre_seed[i - 13]),
SEED_COUNT * sizeof(uint32_t) SEED_COUNT * sizeof(uint32_t)
); );
if(ok) if(ok) {
ygo::pre_seed_specified[i - 13] = 1; // check if it isn't all zero
bool all_zero = true;
for (int j = 0; j < SEED_COUNT; ++j) {
if (ygo::pre_seed[i - 13][j] != 0) {
all_zero = false;
break;
}
}
if (!all_zero)
ygo::pre_seed_specified[i - 13] = 1;
}
else else
std::fprintf(stderr, "Failed to decode seed %d: %s\n", i - 13, argv[i]); std::fprintf(stderr, "Failed to decode seed %d: %s\n", i - 13, argv[i]);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment