fprintf(stderr,
"advent: can't open save file %s for read\n",
optarg);
- signal(SIGINT, sig_handler);
break;
#endif
default:
static void croak(void)
/* Okay, he's dead. Let's get on with it. */
{
+ if (game.numdie < 0)
+ game.numdie = 0;
const char* query = obituaries[game.numdie].query;
const char* yes_response = obituaries[game.numdie].yes_response;
++game.numdie;
}
/* Bounds check for locations */
- if ( valgame.chloc < -1 || valgame.chloc > NLOCATIONS ||
- valgame.chloc2 < -1 || valgame.chloc2 > NLOCATIONS ||
- valgame.loc < -1 || valgame.loc > NLOCATIONS ||
+ 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) {
/* Bounds check for dwarves */
if (valgame.dtotal < 0 || valgame.dtotal > NDWARVES ||
- valgame.dkill < 0 || valgame.dkill > NDWARVES) {
+ valgame.dkill < 0 || valgame.dkill > NDWARVES) {
return false;
}