X-Git-Url: https://jxself.org/git/?p=open-adventure.git;a=blobdiff_plain;f=saveresume.c;h=b03a6215c5c6d11b862add5700eb91a39e5d551e;hp=8bd4418f9e51ac8e2ca0f2ef41b4b4b7cf4e5f00;hb=782c5c3f290555fa9368208efdb3b428f45468eb;hpb=076bb8908bf76e25e9178c178321a7f690b002d8 diff --git a/saveresume.c b/saveresume.c index 8bd4418..b03a621 100644 --- a/saveresume.c +++ b/saveresume.c @@ -1,3 +1,14 @@ +/* + * Saving and resuming. + * + * (ESR) This replaces a bunch of particularly nasty FORTRAN-derived code; + * see the history.adoc file in the source distribution for discussion. + * + * Copyright (c) 1977, 2005 by Will Crowther and Don Woods + * Copyright (c) 2017 by Eric S. Raymond + * SPDX-License-Identifier: BSD-2-clause + */ + #include #include #include @@ -7,11 +18,6 @@ #include "advent.h" #include "dungeon.h" -/* - * (ESR) This replaces a bunch of particularly nasty FORTRAN-derived code; - * see the history.adoc file in the source distribution for discussion. - */ - #define VRSION 28 /* bump on save format change */ /* @@ -153,10 +159,10 @@ bool is_valid(struct game_t* valgame) /* Bounds check for locations */ if ( valgame->chloc < -1 || valgame->chloc > NLOCATIONS || valgame->chloc2 < -1 || valgame->chloc2 > NLOCATIONS || - valgame->loc < -1 || valgame->loc > NLOCATIONS || - valgame->newloc < -1 || valgame->newloc > NLOCATIONS || - valgame->oldloc < -1 || valgame->oldloc > NLOCATIONS || - valgame->oldlc2 < -1 || valgame->oldlc2 > NLOCATIONS) { + valgame->loc < 0 || valgame->loc > NLOCATIONS || + valgame->newloc < 0 || valgame->newloc > NLOCATIONS || + valgame->oldloc < 0 || valgame->oldloc > NLOCATIONS || + valgame->oldlc2 < 0 || valgame->oldlc2 > NLOCATIONS) { return false; } /* Bounds check for location arrays */