Cannot load saved games, says "different version"

Issue #71 resolved
Former user created an issue

wl_loadsave.cpp line 271:

if(strncmp(savesig, SAVESIG, 10) != 0 || // Should be "ECWOLFSAVE"
    atoi(savesig+10) < MINSAVEVER)
{
    sFile.oldVersion = true;
}

Version in the save files is 99999999999, which is larger than INT_MAX, so atoi() overflows and returns 1215752191. MINSAVEVER is 1355980878, so the second comparison is true. A quick way to fix this is to replace the atoi() with atoll(). A better fix is to use smaller version numbers.

Comments (2)

  1. Braden Obrzut

    Should be fixed in f19b6db although I didn't do very thorough testing.

    Those large version numbers are auto generated time stamps of the commit, so using something smaller isn't really an option.

  2. Log in to comment