mapping/detection hangup handling (trunk only)
Noticed while looking at the magic mapping code: u.uinwater is
cleared during mapping and detection so that map updating isn't suppressed
due to underwater vision restrictions, and it was possible for a hangup
save to take place before that state field was reset. After restore, the
hero would end up standing on water, then fall in on the next turn. This
saves it in struct `u' rather than in a local variable, so that the stored
value is accessible during restore.
The u.uburied flag was being ignored, but presumeably it would also
impose severe vision restrictions if it ever gets implemented, so it is
now saved, temporarily cleared, and restored along with u.uinwater during
monster/object/gold/trap detection and magic mapping.
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
* Incrementing EDITLEVEL can be used to force invalidation of old bones
|
||||
* and save files.
|
||||
*/
|
||||
#define EDITLEVEL 49
|
||||
#define EDITLEVEL 50
|
||||
|
||||
#define COPYRIGHT_BANNER_A \
|
||||
"NetHack, Copyright 1985-2011"
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
/* NetHack 3.5 you.h $Date$ $Revision$ */
|
||||
/* SCCS Id: @(#)you.h 3.5 2006/03/01 */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -228,6 +227,14 @@ struct Align {
|
||||
|
||||
extern const struct Align aligns[]; /* table of available alignments */
|
||||
|
||||
/* hangup handling; sometimes u.uinwater is overridden, and we need to
|
||||
be able to reset it in the event of restoring from a hangup save;
|
||||
save/override/restore takes place during normal execution, so this
|
||||
isn't dependent upon current port's signal handling capability */
|
||||
struct huphack {
|
||||
Bitfield(hup_uinwater,1);
|
||||
Bitfield(hup_uburied,1);
|
||||
};
|
||||
|
||||
/*** Information about the player ***/
|
||||
struct you {
|
||||
@@ -361,6 +368,7 @@ struct you {
|
||||
xchar skill_record[P_SKILL_LIMIT]; /* skill advancements */
|
||||
struct skills weapon_skills[P_NUM_SKILLS];
|
||||
boolean twoweap; /* KMH -- Using two-weapon combat */
|
||||
struct huphack save; /* hup_{uinwater,uburied} */
|
||||
|
||||
}; /* end of `struct you' */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user