diff --git a/racing.cpp b/racing.cpp index 9d5e363c..2bb1d5aa 100644 --- a/racing.cpp +++ b/racing.cpp @@ -64,6 +64,7 @@ struct ghostmoment { struct ghost { charstyle cs; int result; + int checksum; time_t timestamp; vector history; }; @@ -100,11 +101,11 @@ void hwrite(hstream& hs, const ghostmoment& m) { } void hread(hstream& hs, ghost& gh) { - hread(hs, gh.cs, gh.result, gh.timestamp, gh.history); + hread(hs, gh.cs, gh.result, gh.timestamp, gh.checksum, gh.history); } void hwrite(hstream& hs, const ghost& gh) { - hwrite(hs, gh.cs, gh.result, gh.timestamp, gh.history); + hwrite(hs, gh.cs, gh.result, gh.timestamp, gh.checksum, gh.history); } bool read_ghosts(string seed, int mcode) { @@ -181,6 +182,8 @@ race_cellinfo& get_info(cell *c) { return rti[rti_id.at(c)]; } +int race_checksum; + ld start_line_width; void generate_track() { @@ -553,6 +556,21 @@ void generate_track() { */ track_ready = true; + race_checksum = hrand(1000000); + + auto& gh = race_ghosts[{track_code, modecode()}] [specialland]; + int ngh = 0; + for(int i=0; i g2.result; }); if(isize(subtrack) > ghosts_to_save && ghosts_to_save > 0) subtrack.resize(ghosts_to_save);