some changes tried while working on issue #1289
display.h -- bring an unused macro up to date detect.c -- always call newsym() when searching or secret door detection finds a trap rather than just when not blind glyphs.c -- some formatting pager.c -- lookat() behaves very strangely when single-stepping in the debugger (gdb); this didn't help
This commit is contained in:
+3
-2
@@ -981,9 +981,10 @@ enum glyph_offsets {
|
|||||||
#if 0
|
#if 0
|
||||||
#define glyph_is_piletop(glyph) \
|
#define glyph_is_piletop(glyph) \
|
||||||
(glyph_is_body_piletop(glyph) \
|
(glyph_is_body_piletop(glyph) \
|
||||||
|| glyph_is_statue_piletop(glyph) \
|
|| glyph_is_fem_statue_piletop(glyph) \
|
||||||
|
|| glyph_is_male_statue_piletop(glyph) \
|
||||||
|| glyph_is_piletop_generic_obj(glyph) \
|
|| glyph_is_piletop_generic_obj(glyph) \
|
||||||
|| glyph_is_obj_piletop(glyph))
|
|| glyph_is_normal_piletop_obj(glyph))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* mgflags for altering map_glyphinfo() internal behavior */
|
/* mgflags for altering map_glyphinfo() internal behavior */
|
||||||
|
|||||||
+6
-5
@@ -1608,10 +1608,11 @@ foundone(coordxy zx, coordxy zy, int glyph)
|
|||||||
if (glyph_is_cmap(glyph) || glyph_is_unexplored(glyph))
|
if (glyph_is_cmap(glyph) || glyph_is_unexplored(glyph))
|
||||||
levl[zx][zy].seenv = SVALL;
|
levl[zx][zy].seenv = SVALL;
|
||||||
|
|
||||||
if (!Blind) {
|
{
|
||||||
seenV save_viz = gv.viz_array[zy][zx];
|
seenV save_viz = gv.viz_array[zy][zx];
|
||||||
|
|
||||||
gv.viz_array[zy][zx] = COULD_SEE | IN_SIGHT;
|
if (!Blind)
|
||||||
|
gv.viz_array[zy][zx] = COULD_SEE | IN_SIGHT;
|
||||||
newsym(zx, zy);
|
newsym(zx, zy);
|
||||||
gv.viz_array[zy][zx] = save_viz;
|
gv.viz_array[zy][zx] = save_viz;
|
||||||
}
|
}
|
||||||
@@ -1665,6 +1666,7 @@ findone(coordxy zx, coordxy zy, genericptr_t whatfound)
|
|||||||
&& ttmp->ttyp != STATUE_TRAP) {
|
&& ttmp->ttyp != STATUE_TRAP) {
|
||||||
flash_glyph_at(zx, zy, trap_to_glyph(ttmp), FOUND_FLASH_COUNT);
|
flash_glyph_at(zx, zy, trap_to_glyph(ttmp), FOUND_FLASH_COUNT);
|
||||||
ttmp->tseen = 1;
|
ttmp->tseen = 1;
|
||||||
|
sense_trap(ttmp, zx, zy, 0); /* handles Hallucination */
|
||||||
foundone(zx, zy, trap_to_glyph(ttmp));
|
foundone(zx, zy, trap_to_glyph(ttmp));
|
||||||
found_p->num_traps++;
|
found_p->num_traps++;
|
||||||
}
|
}
|
||||||
@@ -1673,7 +1675,6 @@ findone(coordxy zx, coordxy zy, genericptr_t whatfound)
|
|||||||
dummytrap.tx = zx, dummytrap.ty = zy;
|
dummytrap.tx = zx, dummytrap.ty = zy;
|
||||||
flash_glyph_at(zx, zy, trap_to_glyph(&dummytrap), FOUND_FLASH_COUNT);
|
flash_glyph_at(zx, zy, trap_to_glyph(&dummytrap), FOUND_FLASH_COUNT);
|
||||||
dummytrap.tseen = 1;
|
dummytrap.tseen = 1;
|
||||||
map_trap(&dummytrap, 1);
|
|
||||||
sense_trap(&dummytrap, zx, zy, 0); /* handles Hallucination */
|
sense_trap(&dummytrap, zx, zy, 0); /* handles Hallucination */
|
||||||
foundone(zx, zy, trap_to_glyph(&dummytrap));
|
foundone(zx, zy, trap_to_glyph(&dummytrap));
|
||||||
found_p->num_traps++;
|
found_p->num_traps++;
|
||||||
@@ -2345,11 +2346,11 @@ reveal_terrain(
|
|||||||
keep_objs = (which_subset & TER_OBJ) != 0,
|
keep_objs = (which_subset & TER_OBJ) != 0,
|
||||||
keep_mons = (which_subset & TER_MON) != 0; /* not used */
|
keep_mons = (which_subset & TER_MON) != 0; /* not used */
|
||||||
unsigned swallowed = u.uswallow; /* before unconstrain_map() */
|
unsigned swallowed = u.uswallow; /* before unconstrain_map() */
|
||||||
|
nhsym default_sym = svl.level.flags.arboreal ? S_tree : S_stone;
|
||||||
|
|
||||||
if (unconstrain_map())
|
if (unconstrain_map())
|
||||||
docrt();
|
docrt();
|
||||||
default_glyph = cmap_to_glyph(svl.level.flags.arboreal ? S_tree
|
default_glyph = cmap_to_glyph(default_sym);
|
||||||
: S_stone);
|
|
||||||
|
|
||||||
for (x = 1; x < COLNO; x++)
|
for (x = 1; x < COLNO; x++)
|
||||||
for (y = 0; y < ROWNO; y++) {
|
for (y = 0; y < ROWNO; y++) {
|
||||||
|
|||||||
+17
-10
@@ -50,7 +50,9 @@ staticfn void shuffle_customizations(void);
|
|||||||
/* staticfn void purge_custom_entries(enum graphics_sets which_set); */
|
/* staticfn void purge_custom_entries(enum graphics_sets which_set); */
|
||||||
|
|
||||||
staticfn void
|
staticfn void
|
||||||
to_custom_symset_entry_callback(int glyph, struct find_struct *findwhat)
|
to_custom_symset_entry_callback(
|
||||||
|
int glyph,
|
||||||
|
struct find_struct *findwhat)
|
||||||
{
|
{
|
||||||
int idx = gs.symset_which_set;
|
int idx = gs.symset_which_set;
|
||||||
#ifdef ENHANCED_SYMBOLS
|
#ifdef ENHANCED_SYMBOLS
|
||||||
@@ -107,7 +109,9 @@ to_custom_symset_entry_callback(int glyph, struct find_struct *findwhat)
|
|||||||
* 0 = failure
|
* 0 = failure
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
glyphrep_to_custom_map_entries(const char *op, int *glyphptr)
|
glyphrep_to_custom_map_entries(
|
||||||
|
const char *op,
|
||||||
|
int *glyphptr)
|
||||||
{
|
{
|
||||||
to_custom_symbol_find = zero_find;
|
to_custom_symbol_find = zero_find;
|
||||||
char buf[BUFSZ], *c_glyphid, *c_unicode, *c_colorval, *cp;
|
char buf[BUFSZ], *c_glyphid, *c_unicode, *c_colorval, *cp;
|
||||||
@@ -222,11 +226,13 @@ glyph_to_cmap(int glyph)
|
|||||||
return glyph_to_explosion(glyph) + S_expl_tl;
|
return glyph_to_explosion(glyph) + S_expl_tl;
|
||||||
else
|
else
|
||||||
return MAXPCHARS; /* MAXPCHARS is legal array index because
|
return MAXPCHARS; /* MAXPCHARS is legal array index because
|
||||||
of trailing fencepost entry */
|
* of trailing fencepost entry */
|
||||||
}
|
}
|
||||||
|
|
||||||
staticfn int
|
staticfn int
|
||||||
glyph_find_core(const char *id, struct find_struct *findwhat)
|
glyph_find_core(
|
||||||
|
const char *id,
|
||||||
|
struct find_struct *findwhat)
|
||||||
{
|
{
|
||||||
int glyph;
|
int glyph;
|
||||||
boolean do_callback, end_find = FALSE;
|
boolean do_callback, end_find = FALSE;
|
||||||
@@ -492,7 +498,7 @@ add_custom_nhcolor_entry(
|
|||||||
gdc->details_end = 0;
|
gdc->details_end = 0;
|
||||||
}
|
}
|
||||||
details = find_matching_customization(customization_name,
|
details = find_matching_customization(customization_name,
|
||||||
custom_nhcolor, which_set);
|
custom_nhcolor, which_set);
|
||||||
if (details) {
|
if (details) {
|
||||||
while (details) {
|
while (details) {
|
||||||
if (details->content.ccolor.glyphidx == glyphidx) {
|
if (details->content.ccolor.glyphidx == glyphidx) {
|
||||||
@@ -503,8 +509,7 @@ add_custom_nhcolor_entry(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* create new details entry */
|
/* create new details entry */
|
||||||
newdetails = (struct customization_detail *) alloc(
|
newdetails = (struct customization_detail *) alloc(sizeof *newdetails);
|
||||||
sizeof (struct customization_detail));
|
|
||||||
newdetails->content.urep.glyphidx = glyphidx;
|
newdetails->content.urep.glyphidx = glyphidx;
|
||||||
newdetails->content.ccolor.nhcolor = nhcolor;
|
newdetails->content.ccolor.nhcolor = nhcolor;
|
||||||
newdetails->next = (struct customization_detail *) 0;
|
newdetails->next = (struct customization_detail *) 0;
|
||||||
@@ -520,8 +525,8 @@ add_custom_nhcolor_entry(
|
|||||||
|
|
||||||
void
|
void
|
||||||
apply_customizations(
|
apply_customizations(
|
||||||
enum graphics_sets which_set,
|
enum graphics_sets which_set,
|
||||||
enum do_customizations docustomize)
|
enum do_customizations docustomize)
|
||||||
{
|
{
|
||||||
glyph_map *gmap;
|
glyph_map *gmap;
|
||||||
struct customization_detail *details;
|
struct customization_detail *details;
|
||||||
@@ -802,7 +807,9 @@ wizcustom_glyphids(winid win)
|
|||||||
}
|
}
|
||||||
|
|
||||||
staticfn int
|
staticfn int
|
||||||
parse_id(const char *id, struct find_struct *findwhat)
|
parse_id(
|
||||||
|
const char *id,
|
||||||
|
struct find_struct *findwhat)
|
||||||
{
|
{
|
||||||
FILE *fp = (FILE *) 0;
|
FILE *fp = (FILE *) 0;
|
||||||
int i = 0, j, mnum, glyph,
|
int i = 0, j, mnum, glyph,
|
||||||
|
|||||||
+5
-5
@@ -694,6 +694,8 @@ lookat(coordxy x, coordxy y, char *buf, char *monbuf)
|
|||||||
int warnindx = glyph_to_warning(glyph);
|
int warnindx = glyph_to_warning(glyph);
|
||||||
|
|
||||||
Strcpy(buf, def_warnsyms[warnindx].explanation);
|
Strcpy(buf, def_warnsyms[warnindx].explanation);
|
||||||
|
} else if (glyph_is_invisible(glyph)) {
|
||||||
|
Strcpy(buf, invisexplain); /* redundant; handled by caller */
|
||||||
} else if (glyph_is_nothing(glyph)) {
|
} else if (glyph_is_nothing(glyph)) {
|
||||||
Strcpy(buf, "dark part of a room");
|
Strcpy(buf, "dark part of a room");
|
||||||
} else if (glyph_is_unexplored(glyph)) {
|
} else if (glyph_is_unexplored(glyph)) {
|
||||||
@@ -704,11 +706,7 @@ lookat(coordxy x, coordxy y, char *buf, char *monbuf)
|
|||||||
} else {
|
} else {
|
||||||
Strcpy(buf, "unexplored area");
|
Strcpy(buf, "unexplored area");
|
||||||
}
|
}
|
||||||
} else if (glyph_is_invisible(glyph)) {
|
} else if (glyph_is_cmap(glyph)) {
|
||||||
/* already handled */
|
|
||||||
} else if (!glyph_is_cmap(glyph)) {
|
|
||||||
Strcpy(buf, "unexplored area");
|
|
||||||
} else {
|
|
||||||
int amsk;
|
int amsk;
|
||||||
aligntyp algn;
|
aligntyp algn;
|
||||||
short symidx = glyph_to_cmap(glyph);
|
short symidx = glyph_to_cmap(glyph);
|
||||||
@@ -767,6 +765,8 @@ lookat(coordxy x, coordxy y, char *buf, char *monbuf)
|
|||||||
Strcpy(buf, defsyms[symidx].explanation);
|
Strcpy(buf, defsyms[symidx].explanation);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
} else { /* not mon, obj, trap, or cmap */
|
||||||
|
Strcpy(buf, "unexplored area");
|
||||||
}
|
}
|
||||||
return (pm && !Hallucination) ? pm : (struct permonst *) 0;
|
return (pm && !Hallucination) ? pm : (struct permonst *) 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user