Per Inge Mathisen schreef:
> On Tue, Sep 16, 2008 at 10:09 PM, Giel van Schijndel <[EMAIL PROTECTED]> 
> wrote:
>> That area of memory is currently memset(0) before writing to disk right?
>> We could try to take some "fail gracefully" approach and reject the
>> savegame if that piece of memory is zero. Where "fail gracefully" means
>> display some nice error message to the user explaining the problem.
>>
>> Unless someone has some other way to handle this.
> 
> We are actually so lucky that the zone information is at the very end
> of the savegame, so we can check for EOF when done with everything
> else, and return false from the load functions if nothing is found.

I updated the patch to check for the absence of zone information and
return false if that's the case.

> What then happens next, I do not know, but I fear there are lots of
> asserts waiting in ambush...

Nope, no asserts, several debug() calls yes, but no asserts.

Also I've traced the calling tree down to one function: loadGameInit
which'll return false whenever game loading fails. This function is only
called by initSaveGameLoad (main.c) and startMission (mission.c), the
latter being only used to load campaign missions (not savegames).

Thus the only function that should be of a concern to us in this regards
is initSaveGameLoad. Currently this function calls exit(EXIT_FAILURE) if
loadGameInit fails. That's the place where the behaviour should probably
be altered such that instead we display some in-GUI message to the user.
(Especially for the non-terminal systems: Max & Windows).

-- 
Giel


Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Warzone-dev mailing list
Warzone-dev@gna.org
https://mail.gna.org/listinfo/warzone-dev

Reply via email to