fix #H348 - "you trip over it" after non-"it" message (trunk only)
Reported to us by <email deleted>:
'You are beginning to feel hungry. You trip over it.'
and also recently in the newsgroup by "<Someone>":
There is ice here. *You see here an electric eel corpse.*
Bib hits the electric eel. Bib misses the electric eel.
Bib misses the electric eel. The electric eel misses Bib.
The electric eel misses Bib. *You trip over it.*
slip_or_trip() was oversimplifying things by assuming that if there
is one object at the hero's location, a message about what that object is
has just been given. Any timeout message which precedes Fumbling (lots
of candiates besides hunger) could intervene, as could monster activity
between the hero's move and timeout handling. Aside from the reported
cases, that code hadn't been updated to account for the new pile_limit
option which could be set to 1 and force a popup display instead of the
usual "you see <an item> here". This fix adds a flag that can be used
to track the most recent message. It is cleared by pline for every
message, so pline's caller sets it _after_ the message of interest has
been displayed.
This commit is contained in:
@@ -159,6 +159,7 @@ struct instance_flags {
|
||||
* a structure of their own elsewhere some day.
|
||||
*/
|
||||
int in_lava_effects; /* hack for Boots_off() */
|
||||
int last_msg; /* indicator of last message player saw */
|
||||
int purge_monsters; /* # of dead monsters still on fmon list */
|
||||
int override_ID; /* true to force full identification of objects */
|
||||
int suppress_price; /* controls doname() for unpaid objects */
|
||||
@@ -320,6 +321,10 @@ extern NEARDATA struct sysflag sysflags;
|
||||
#endif
|
||||
extern NEARDATA struct instance_flags iflags;
|
||||
|
||||
/* last_msg values */
|
||||
#define PLNMSG_UNKNOWN 0 /* arbitrary */
|
||||
#define PLNMSG_ONE_ITEM_HERE 1 /* "you see <single item> here" */
|
||||
|
||||
/* runmode options */
|
||||
#define RUN_TPORT 0 /* don't update display until movement stops */
|
||||
#define RUN_LEAP 1 /* update display every 7 steps */
|
||||
|
||||
Reference in New Issue
Block a user