diff --git a/src/cmd.c b/src/cmd.c index 0cbcaba66..f05787fe3 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 cmd.c $NHDT-Date: 1544920233 2018/12/16 00:30:33 $ $NHDT-Branch: win-minor $:$NHDT-Revision: 1.321 $ */ +/* NetHack 3.6 cmd.c $NHDT-Date: 1545128652 2018/12/18 10:24:12 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.322 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2013. */ /* NetHack may be freely redistributed. See license for details. */ @@ -5544,7 +5544,6 @@ parse() static char in_line[COLNO]; #endif register int foo; - boolean prezero = FALSE; iflags.in_parse = TRUE; multi = 0; @@ -5617,8 +5616,6 @@ parse() in_line[2] = 0; } clear_nhwindow(WIN_MESSAGE); - if (prezero) - in_line[0] = Cmd.spkeys[NHKF_ESC]; iflags.in_parse = FALSE; return in_line; diff --git a/src/mhitu.c b/src/mhitu.c index 85293d57b..67966db5f 100644 --- a/src/mhitu.c +++ b/src/mhitu.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 mhitu.c $NHDT-Date: 1540767817 2018/10/28 23:03:37 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.159 $ */ +/* NetHack 3.6 mhitu.c $NHDT-Date: 1545130893 2018/12/18 11:01:33 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.160 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2012. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1989,12 +1989,12 @@ boolean ufound; if (mtmp->mcan) return 0; - if (!ufound) + if (!ufound) { pline("%s explodes at a spot in %s!", canseemon(mtmp) ? Monnam(mtmp) : "It", levl[mtmp->mux][mtmp->muy].typ == WATER ? "empty water" : "thin air"); - else { + } else { int tmp = d((int) mattk->damn, (int) mattk->damd); boolean not_affected = defends((int) mattk->adtyp, uwep); @@ -2012,6 +2012,13 @@ boolean ufound; case AD_ELEC: physical_damage = FALSE; not_affected |= Shock_resistance; + goto common; + case AD_PHYS: + /* there aren't any exploding creatures with AT_EXPL attack + for AD_PHYS damage but there might be someday; without this, + static analysis complains that 'physical_damage' is always + False when tested below; it's right, but having that in + place means one less thing to update if AD_PHYS gets added */ common: if (!not_affected) { diff --git a/src/pager.c b/src/pager.c index 22df977e4..6982860c9 100644 --- a/src/pager.c +++ b/src/pager.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 pager.c $NHDT-Date: 1543185072 2018/11/25 22:31:12 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.139 $ */ +/* NetHack 3.6 pager.c $NHDT-Date: 1545129848 2018/12/18 10:44:08 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.142 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2018. */ /* NetHack may be freely redistributed. See license for details. */ @@ -527,14 +527,14 @@ char *supplemental_name; fp = dlb_fopen(DATAFILE, "r"); if (!fp) { - pline("Cannot open data file!"); + pline("Cannot open 'data' file!"); return; } /* If someone passed us garbage, prevent fault. */ if (!inp || strlen(inp) > (BUFSZ - 1)) { impossible("bad do_look buffer passed (%s)!", !inp ? "null" : "too long"); - return; + goto checkfile_done; } /* To prevent the need for entries in data.base like *ngel to account diff --git a/src/priest.c b/src/priest.c index 4a3dd185d..d97886c73 100644 --- a/src/priest.c +++ b/src/priest.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 priest.c $NHDT-Date: 1501725407 2017/08/03 01:56:47 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.44 $ */ +/* NetHack 3.6 priest.c $NHDT-Date: 1545131519 2018/12/18 11:11:59 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.45 $ */ /* Copyright (c) Izchak Miller, Steve Linhart, 1989. */ /* NetHack may be freely redistributed. See license for details. */ @@ -53,7 +53,9 @@ register xchar omx, omy, gx, gy; coord poss[9]; long info[9]; long allowflags; +#if 0 /* dead code; see below */ struct obj *ib = (struct obj *) 0; +#endif if (omx == gx && omy == gy) return 0; @@ -121,6 +123,7 @@ pick_move: newsym(nix, niy); if (mtmp->isshk && !in_his_shop && inhishop(mtmp)) check_special_room(FALSE); +#if 0 /* dead code; maybe someday someone will track down why... */ if (ib) { if (cansee(mtmp->mx, mtmp->my)) pline("%s picks up %s.", Monnam(mtmp), @@ -128,6 +131,7 @@ pick_move: obj_extract_self(ib); (void) mpickobj(mtmp, ib); } +#endif return 1; } return 0; diff --git a/src/rumors.c b/src/rumors.c index a0f367952..033a0126c 100644 --- a/src/rumors.c +++ b/src/rumors.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 rumors.c $NHDT-Date: 1542422933 2018/11/17 02:48:53 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.30 $ */ +/* NetHack 3.6 rumors.c $NHDT-Date: 1545132266 2018/12/18 11:24:26 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.34 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2012. */ /* NetHack may be freely redistributed. See license for details. */ @@ -183,13 +183,15 @@ boolean exclude_cookie; void rumor_check() { - dlb *rumors; + dlb *rumors = 0; winid tmpwin; char *endp, line[BUFSZ], xbuf[BUFSZ], rumor_buf[BUFSZ]; if (true_rumor_size < 0L) { /* we couldn't open RUMORFILE */ no_rumors: pline("rumors not accessible."); + if (rumors) + (void) dlb_fclose(rumors); return; } @@ -423,11 +425,10 @@ outoracle(special, delphi) boolean special; boolean delphi; { - char line[COLNO]; - char *endp; + winid tmpwin; dlb *oracles; int oracle_idx; - char xbuf[BUFSZ]; + char *endp, line[COLNO], xbuf[BUFSZ]; /* early return if we couldn't open ORACLEFILE on previous attempt, or if all the oracularities are already exhausted */ @@ -437,17 +438,16 @@ boolean delphi; oracles = dlb_fopen(ORACLEFILE, "r"); if (oracles) { - winid tmpwin; if (oracle_flg == 0) { /* if this is the first outoracle() */ init_oracles(oracles); oracle_flg = 1; if (oracle_cnt == 0) - return; + goto close_oracles; } /* oracle_loc[0] is the special oracle; oracle_loc[1..oracle_cnt-1] are normal ones */ if (oracle_cnt <= 1 && !special) - return; /*(shouldn't happen)*/ + goto close_oracles; /*(shouldn't happen)*/ oracle_idx = special ? 0 : rnd((int) oracle_cnt - 1); (void) dlb_fseek(oracles, (long) oracle_loc[oracle_idx], SEEK_SET); if (!special) /* move offset of very last one into this slot */ @@ -470,6 +470,7 @@ boolean delphi; } display_nhwindow(tmpwin, TRUE); destroy_nhwindow(tmpwin); + close_oracles: (void) dlb_fclose(oracles); } else { couldnt_open_file(ORACLEFILE);