diff --git a/src/app/main.cpp b/src/app/main.cpp index 67d0dd3..92fda89 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -278,6 +278,24 @@ int main(int argc, char** argv) { capture.blocks.size(), capture.seeds.size()); for (const auto& kv : capture.meta) std::printf(" %s: %s\n", kv.first.c_str(), kv.second.c_str()); + // A CAPTURE BELONGS TO ONE SAVE. Replaying a turn's commands against a different board + // is not an error the arithmetic can see -- the blocks name player ids that exist in + // both, so it charges the counter happily and produces a confident wrong number. When + // the capture records which save it was taken on, check it. + if (const std::string* bound = capture.Meta("input")) { + const std::string want = bound->substr(0, bound->find(' ')); + std::string have = in; + const std::size_t slash = have.find_last_of("/\\"); + if (slash != std::string::npos) have = have.substr(slash + 1); + if (!want.empty() && want != have) + std::printf("turn-commands: ! this capture was taken on '%s' and is being " + "replayed against '%s'. A capture belongs to ONE board; the counter " + "will be charged either way and the number will be wrong.\n", + want.c_str(), have.c_str()); + } else { + std::printf("turn-commands: ! this capture does not record which save it was taken " + "on, so nothing here can tell whether it belongs to this one\n"); + } } // Seeds given on the command line win over the ones in the file, and a seed for a client the // file does not mention is added. Nothing consumes them yet, so this is bookkeeping with a