Merge branch 'NetHack-3.6'

This commit is contained in:
nhmall
2019-10-27 12:01:38 -04:00
5 changed files with 77 additions and 45 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 cmd.c $NHDT-Date: 1565574994 2019/08/12 01:56:34 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.343 $ */
/* NetHack 3.6 cmd.c $NHDT-Date: 1572141702 2019/10/27 02:01:42 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.347 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2013. */
/* NetHack may be freely redistributed. See license for details. */
@@ -853,6 +853,7 @@ wiz_makemap(VOID_ARGS)
u_on_rndspot((u.uhave.amulet ? 1 : 0) /* 'going up' flag */
| (was_in_W_tower ? 2 : 0));
losedogs();
kill_genocided_monsters();
/* u_on_rndspot() might pick a spot that has a monster, or losedogs()
might pick the hero's spot (only if there isn't already a monster
there), so we might have to move hero or the co-located monster */
@@ -6038,19 +6039,27 @@ const char *prompt;
to give the go-ahead for this query; default is "no" unless the
ParanoidConfirm flag is set in which case there's no default */
if (be_paranoid) {
char qbuf[QBUFSZ], ans[BUFSZ] = DUMMY;
const char *promptprefix = "", *responsetype = ParanoidConfirm
? "(yes|no)"
: "(yes) [no]";
int trylimit = 6; /* 1 normal, 5 more with "Yes or No:" prefix */
char pbuf[BUFSZ], qbuf[QBUFSZ], ans[BUFSZ];
const char *promptprefix = "",
*responsetype = ParanoidConfirm ? "(yes|no)" : "(yes) [no]";
int k, trylimit = 6; /* 1 normal, 5 more with "Yes or No:" prefix */
copynchars(pbuf, prompt, BUFSZ - 1);
/* in addition to being paranoid about this particular
query, we might be even more paranoid about all paranoia
responses (ie, ParanoidConfirm is set) in which case we
require "no" to reject in addition to "yes" to confirm
(except we won't loop if response is ESC; it means no) */
do {
Sprintf(qbuf, "%s%s %s", promptprefix, prompt, responsetype);
/* make sure we won't overflow a QBUFSZ sized buffer */
k = (int) (strlen(promptprefix) + 1 + strlen(responsetype));
if ((int) strlen(pbuf) + k > QBUFSZ - 1) {
/* chop off some at the end */
Strcpy(pbuf + (QBUFSZ - 1) - k - 4, "...?"); /* -4: "...?" */
}
Sprintf(qbuf, "%s%s %s", promptprefix, pbuf, responsetype);
*ans = '\0';
getlin(qbuf, ans);
(void) mungspaces(ans);
confirmed_ok = !strcmpi(ans, "yes");