latent level arrival message bug (trunk only)
Something I noticed during a level change in slash'em:
You hear the sounds of civilization. You fly down the stairs.
The first message ought to follow the second. Our only arrival messages
that are handled via the special level loader occur in the endgame where
travel is by magic portal, and the transit message given for portals is
for entering one rather than exiting at the far side, so this sequencing
problem can't currently be noticed in nethack. But sooner or later there
will be levels reachable by stairs and having entry messages, or there'll
be some feedback added when magic portal transport finishes, and then we'd
get bitten by this.
Tested by adding an arrival message to each of the bigroom variants.
This commit is contained in:
5
src/do.c
5
src/do.c
@@ -1,4 +1,4 @@
|
||||
/* SCCS Id: @(#)do.c 3.5 2005/09/02 */
|
||||
/* SCCS Id: @(#)do.c 3.5 2006/02/15 */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -1308,6 +1308,9 @@ boolean at_stairs, falling, portal;
|
||||
* Move all plines beyond the screen reset.
|
||||
*/
|
||||
|
||||
/* special levels can have a custom arrival message */
|
||||
deliver_splev_message();
|
||||
|
||||
/* give room entrance message, if any */
|
||||
check_special_room(FALSE);
|
||||
|
||||
|
||||
24
src/mkmaze.c
24
src/mkmaze.c
@@ -475,21 +475,29 @@ fixup_special()
|
||||
}
|
||||
}
|
||||
|
||||
if(lev_message) {
|
||||
char *str, *nl;
|
||||
for(str = lev_message; (nl = index(str, '\n')) != 0; str = nl+1) {
|
||||
if (lregions)
|
||||
free((genericptr_t) lregions), lregions = 0;
|
||||
num_lregions = 0;
|
||||
}
|
||||
|
||||
/* special levels can include a custom arrival message; display it */
|
||||
void
|
||||
deliver_splev_message()
|
||||
{
|
||||
char *str, *nl;
|
||||
|
||||
/* this used to be inline within fixup_special(),
|
||||
but then the message ended up being given too soon */
|
||||
if (lev_message) {
|
||||
for (str = lev_message; (nl = index(str, '\n')) != 0; str = nl + 1) {
|
||||
*nl = '\0';
|
||||
pline("%s", str);
|
||||
}
|
||||
if(*str)
|
||||
if (*str)
|
||||
pline("%s", str);
|
||||
free((genericptr_t)lev_message);
|
||||
lev_message = 0;
|
||||
}
|
||||
|
||||
if (lregions)
|
||||
free((genericptr_t) lregions), lregions = 0;
|
||||
num_lregions = 0;
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user