SpiritQuaddicted / reQuiem

reQuiem is a custom OpenGL Quake engine for Windows and Linux. It's designed for maximum compatibility with all things Quake - past, present and future. It's fast, reliable, and easy to configure. In short: it fixes what was broken, improves what needed improving, and leaves the rest alone. It was developed by jdhack.
GNU General Public License v2.0
17 stars 2 forks source link

Quickloading this savegame crashes engine #35

Closed SpiritQuaddicted closed 10 years ago

SpiritQuaddicted commented 10 years ago

http://quaketastic.com/files/misc/requiem-crash-fmb6.7z is a savegame for https://www.quaddicted.com/reviews/fmb6.html

Trying to load it makes the engine crash/quit.

Loading game from ./id1/quick.sav...
Detected fish-count bug in progs.dat; monster count has been adjusted
'ping' is not a field
'netaddress' is not a field
'playermodel' is not a field
'playerskin' is not a field
'cursor_trace_endpos' is not a field
'cursor_trace_start' is not a field
Error: First token isn't a brace

I am not sure if it was corrupted on writing

SpiritQuaddicted commented 10 years ago

Erm, on second look I am not sure what happened here. Apparently I did not save on fmb6 but this is an older quick save on e4m5. Sorry about that. Can't remember what I did there and how those fields (or non-fields) came to existence. Still, it crashes.

I am not sure if this is ok or not. At least it would be nice to just print the error to the console instead of quitting.

SpiritQuaddicted commented 10 years ago

Recent Quakespasm, Darkplaces and Tyrquake load it. Fitzquake (Exe: 16:04:11 Jul 5 2008) behaves the same as reQuiem. FTEQW prints the same "not a field" messages but loads it then.

neogeographica commented 10 years ago

It works if you delete the "DarkPlaces extended savegame" block from the end of the save file.

I haven't done any tests of a fix yet, but on code examination I see that COM_Parse in QuakeSpasm knows how to deal with C-style comment blocks in save files ("/* ... */") while COM_Parse in reQuiem does not. Probably the next thing to do is to steal from QuakeSpasm and try changing this code:

// skip // comments
    if (c == '/' && data[1] == '/')
    {
        while (*data && *data != '\n')
            data++;
        goto skipwhite;
    }

to this:

// skip // comments
    if (c == '/' && data[1] == '/')
    {
        while (*data && *data != '\n')
            data++;
        goto skipwhite;
    }

// skip /*..*/ comments
    if (c == '/' && data[1] == '*')
    {
        data += 2;
        while (*data && !(*data == '*' && data[1] == '/'))
            data++;
        if (*data)
            data += 2;
        goto skipwhite;
    }
neogeographica commented 10 years ago

Yup that seems to do it. Going to test a bit more before doing a pull request.