Merge branch 'NetHack-3.6'

This commit is contained in:
nhmall
2019-07-13 00:38:10 -04:00
27 changed files with 123 additions and 89 deletions

View File

@@ -139,7 +139,7 @@ const char *str;
putsyms(str);
cl_end();
ttyDisplay->toplin = TOPLINE_NEED_MORE;
if (ttyDisplay->cury && otoplin != 3)
if (ttyDisplay->cury && otoplin != TOPLINE_SPECIAL_PROMPT)
more();
}
@@ -204,12 +204,15 @@ more()
{
struct WinDesc *cw = wins[WIN_MESSAGE];
/* avoid recursion -- only happens from interrupts */
if (ttyDisplay->inmore++)
return;
if (iflags.debug_fuzzer)
return;
/* avoid recursion -- only happens from interrupts */
if (ttyDisplay->inmore)
return;
ttyDisplay->inmore++;
if (ttyDisplay->toplin) {
tty_curs(BASE_WINDOW, cw->curx + 1, cw->cury);
if (cw->curx >= CO - 8)
@@ -256,7 +259,8 @@ register const char *bp;
&& cw->cury == 0
&& n0 + (int) strlen(g.toplines) + 3 < CO - 8 /* room for --More-- */
&& (notdied = strncmp(bp, "You die", 7)) != 0) {
Strcat(g.toplines, " ");
nhassert((long) strlen(g.toplines) == cw->curx);
Strcat(toplines, " ");
Strcat(g.toplines, bp);
cw->curx += 2;
if (!(cw->flags & WIN_STOP))
@@ -309,6 +313,7 @@ char c;
if (ttyDisplay->curx == 0 && ttyDisplay->cury > 0)
tty_curs(BASE_WINDOW, CO, (int) ttyDisplay->cury - 1);
backsp();
nhassert(ttyDisplay->curx > 0);
ttyDisplay->curx--;
cw->curx = ttyDisplay->curx;
return;
@@ -686,6 +691,13 @@ boolean restoring_msghist;
}
if (msg) {
/* Caller is asking us to remember a top line that needed more.
Should we call more? This can happen when the player has set
iflags.force_invmenu and they attempt to shoot with nothing in
the quiver. */
if (ttyDisplay && ttyDisplay->toplin == TOPLINE_NEED_MORE)
ttyDisplay->toplin = TOPLINE_NON_EMPTY;
/* move most recent message to history, make this become most recent */
remember_topl();
Strcpy(g.toplines, msg);
@@ -693,6 +705,9 @@ boolean restoring_msghist;
dumplogmsg(g.toplines);
#endif
} else if (snapshot_mesgs) {
nhassert(ttyDisplay == NULL ||
ttyDisplay->toplin != TOPLINE_NEED_MORE);
/* done putting arbitrary messages in; put the snapshot ones back */
for (idx = 0; snapshot_mesgs[idx]; ++idx) {
remember_topl();

View File

@@ -2319,7 +2319,7 @@ boolean blocking; /* with ttys, all windows are blocking */
more();
ttyDisplay->toplin = TOPLINE_NEED_MORE; /* more resets this */
tty_clear_nhwindow(window);
/* nhassert(ttyDisplay->toplin == TOPLINE_EMPTY); */
nhassert(ttyDisplay->toplin == TOPLINE_EMPTY);
} else
ttyDisplay->toplin = TOPLINE_EMPTY;
cw->curx = cw->cury = 0;
@@ -2407,7 +2407,7 @@ winid window;
case NHW_MESSAGE:
if (ttyDisplay->toplin != TOPLINE_EMPTY)
tty_display_nhwindow(WIN_MESSAGE, TRUE);
/* nhassert(ttyDisplay->toplin == TOPLINE_EMPTY); */
nhassert(ttyDisplay->toplin == TOPLINE_EMPTY);
/*FALLTHRU*/
case NHW_STATUS:
case NHW_BASE:
@@ -3162,7 +3162,7 @@ const char *mesg;
more();
ttyDisplay->toplin = TOPLINE_NEED_MORE; /* more resets this */
tty_clear_nhwindow(WIN_MESSAGE);
/* nhassert(ttyDisplay->toplin == TOPLINE_EMPTY); */
nhassert(ttyDisplay->toplin == TOPLINE_EMPTY);
}
/* normally <ESC> means skip further messages, but in this case
it means cancel the current prompt; any other messages should
@@ -4130,7 +4130,7 @@ boolean force_update;
* must be updated because they need to change.
* This is now done at an individual field case-by-case level.
*/
boolean
STATIC_OVL boolean
check_fields(forcefields, sz)
boolean forcefields;
int sz[3];