Merge branch 'NetHack-3.6'
This commit is contained in:
@@ -404,12 +404,6 @@ struct early_opt {
|
|||||||
boolean valallowed;
|
boolean valallowed;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* topline states */
|
|
||||||
#define TOPLINE_EMPTY 0 /* empty */
|
|
||||||
#define TOPLINE_NEED_MORE 1 /* non-empty, need --More-- */
|
|
||||||
#define TOPLINE_NON_EMPTY 2 /* non-empty, no --More-- required */
|
|
||||||
#define TOPLINE_SPECIAL_PROMPT 3 /* special prompt state */
|
|
||||||
|
|
||||||
/* special key functions */
|
/* special key functions */
|
||||||
enum nh_keyfunc {
|
enum nh_keyfunc {
|
||||||
NHKF_ESC = 0,
|
NHKF_ESC = 0,
|
||||||
|
|||||||
@@ -1931,6 +1931,7 @@ E void VDECL(verbalize, (const char *, ...)) PRINTF_F(1, 2);
|
|||||||
E void VDECL(raw_printf, (const char *, ...)) PRINTF_F(1, 2);
|
E void VDECL(raw_printf, (const char *, ...)) PRINTF_F(1, 2);
|
||||||
E void VDECL(impossible, (const char *, ...)) PRINTF_F(1, 2);
|
E void VDECL(impossible, (const char *, ...)) PRINTF_F(1, 2);
|
||||||
E void VDECL(config_error_add, (const char *, ...)) PRINTF_F(1, 2);
|
E void VDECL(config_error_add, (const char *, ...)) PRINTF_F(1, 2);
|
||||||
|
E void FDECL(nhassert_failed, (const char *, int));
|
||||||
|
|
||||||
/* ### polyself.c ### */
|
/* ### polyself.c ### */
|
||||||
|
|
||||||
|
|||||||
@@ -380,5 +380,10 @@ struct savefile_info {
|
|||||||
#define nhassert(e) ((void)0)
|
#define nhassert(e) ((void)0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Supply nhassert macro if not supplied by port */
|
||||||
|
#ifndef nhassert
|
||||||
|
#define nhassert(expression) (void)((!!(expression)) || \
|
||||||
|
(nhassert_failed(__FILE__, __LINE__), 0))
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* GLOBAL_H */
|
#endif /* GLOBAL_H */
|
||||||
|
|||||||
+12
-18
@@ -134,6 +134,8 @@ extern void NDECL(getlock);
|
|||||||
#ifndef HAS_STDINT_H
|
#ifndef HAS_STDINT_H
|
||||||
#define HAS_STDINT_H /* force include of stdint.h in integer.h */
|
#define HAS_STDINT_H /* force include of stdint.h in integer.h */
|
||||||
#endif
|
#endif
|
||||||
|
/* Turn on some additional warnings */
|
||||||
|
#pragma warning(3:4389)
|
||||||
#endif /* _MSC_VER */
|
#endif /* _MSC_VER */
|
||||||
|
|
||||||
/* The following is needed for prototypes of certain functions */
|
/* The following is needed for prototypes of certain functions */
|
||||||
@@ -146,14 +148,6 @@ extern void NDECL(getlock);
|
|||||||
#define strncmpi(a, b, c) strnicmp(a, b, c)
|
#define strncmpi(a, b, c) strnicmp(a, b, c)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
/* Visual Studio defines this in their own headers, which we don't use */
|
|
||||||
#ifndef snprintf
|
|
||||||
#define snprintf _snprintf
|
|
||||||
#pragma warning( \
|
|
||||||
disable : 4996) /* deprecation warning suggesting snprintf_s */
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -274,17 +268,17 @@ extern int FDECL(set_win32_option, (const char *, const char *));
|
|||||||
extern int FDECL(alternative_palette, (char *));
|
extern int FDECL(alternative_palette, (char *));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef NDEBUG
|
|
||||||
#define nhassert(expression) ((void)0)
|
|
||||||
#else
|
|
||||||
extern void FDECL(nhassert_failed, (const char * exp, const char * file,
|
|
||||||
int line));
|
|
||||||
|
|
||||||
#define nhassert(expression) (void)((!!(expression)) || \
|
|
||||||
(nhassert_failed(#expression, __FILE__, __LINE__), 0))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define nethack_enter(argc, argv) nethack_enter_winnt()
|
#define nethack_enter(argc, argv) nethack_enter_winnt()
|
||||||
extern void FDECL(nethack_exit, (int)) NORETURN;
|
extern void FDECL(nethack_exit, (int)) NORETURN;
|
||||||
extern boolean FDECL(file_exists, (const char *));
|
extern boolean FDECL(file_exists, (const char *));
|
||||||
|
|
||||||
|
/* Override the default version of nhassert. The default version is unable
|
||||||
|
* to generate a string form of the expression due to the need to be
|
||||||
|
* compatible with compilers which do not support macro stringization (i.e.
|
||||||
|
* #x to turn x into its string form).
|
||||||
|
*/
|
||||||
|
extern void FDECL(nt_assert_failed, (const char *, const char *, int));
|
||||||
|
#define nhassert(expression) (void)((!!(expression)) || \
|
||||||
|
(nt_assert_failed(#expression, __FILE__, __LINE__), 0))
|
||||||
|
|
||||||
#endif /* NTCONF_H */
|
#endif /* NTCONF_H */
|
||||||
|
|||||||
@@ -50,6 +50,12 @@ struct WinDesc {
|
|||||||
#define WIN_STOP 1 /* for NHW_MESSAGE; stops output */
|
#define WIN_STOP 1 /* for NHW_MESSAGE; stops output */
|
||||||
#define WIN_LOCKHISTORY 2 /* for NHW_MESSAGE; suppress history updates */
|
#define WIN_LOCKHISTORY 2 /* for NHW_MESSAGE; suppress history updates */
|
||||||
|
|
||||||
|
/* topline states */
|
||||||
|
#define TOPLINE_EMPTY 0 /* empty */
|
||||||
|
#define TOPLINE_NEED_MORE 1 /* non-empty, need --More-- */
|
||||||
|
#define TOPLINE_NON_EMPTY 2 /* non-empty, no --More-- required */
|
||||||
|
#define TOPLINE_SPECIAL_PROMPT 3 /* special prompt state */
|
||||||
|
|
||||||
/* descriptor for tty-based displays -- all the per-display data */
|
/* descriptor for tty-based displays -- all the per-display data */
|
||||||
struct DisplayDesc {
|
struct DisplayDesc {
|
||||||
short rows, cols; /* width and height of tty display */
|
short rows, cols; /* width and height of tty display */
|
||||||
|
|||||||
+1
-1
@@ -881,7 +881,7 @@ enum earlyarg e_arg;
|
|||||||
* optimization so that display output
|
* optimization so that display output
|
||||||
* can be debugged without buffering.
|
* can be debugged without buffering.
|
||||||
*/
|
*/
|
||||||
void
|
STATIC_OVL void
|
||||||
debug_fields(opts)
|
debug_fields(opts)
|
||||||
const char *opts;
|
const char *opts;
|
||||||
{
|
{
|
||||||
|
|||||||
+3
-3
@@ -1595,7 +1595,7 @@ int x,y;
|
|||||||
&& is_valid_jump_pos(x, y, g.jumping_is_magic, FALSE));
|
&& is_valid_jump_pos(x, y, g.jumping_is_magic, FALSE));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
STATIC_OVL void
|
||||||
display_jump_positions(state)
|
display_jump_positions(state)
|
||||||
int state;
|
int state;
|
||||||
{
|
{
|
||||||
@@ -2848,7 +2848,7 @@ static const char
|
|||||||
cant_reach[] = "can't reach that spot from here.";
|
cant_reach[] = "can't reach that spot from here.";
|
||||||
|
|
||||||
/* find pos of monster in range, if only one monster */
|
/* find pos of monster in range, if only one monster */
|
||||||
boolean
|
STATIC_OVL boolean
|
||||||
find_poleable_mon(pos, min_range, max_range)
|
find_poleable_mon(pos, min_range, max_range)
|
||||||
coord *pos;
|
coord *pos;
|
||||||
int min_range, max_range;
|
int min_range, max_range;
|
||||||
@@ -2901,7 +2901,7 @@ int x, y;
|
|||||||
&& distu(x, y) <= g.polearm_range_max);
|
&& distu(x, y) <= g.polearm_range_max);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
STATIC_OVL void
|
||||||
display_polearm_positions(state)
|
display_polearm_positions(state)
|
||||||
int state;
|
int state;
|
||||||
{
|
{
|
||||||
|
|||||||
+2
-2
@@ -520,7 +520,7 @@ STATIC_VAR struct istat_s initblstats[MAXBLSTATS] = {
|
|||||||
* without STATUS_HILITES.
|
* without STATUS_HILITES.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void
|
STATIC_OVL void
|
||||||
bot_via_windowport()
|
bot_via_windowport()
|
||||||
{
|
{
|
||||||
char buf[BUFSZ];
|
char buf[BUFSZ];
|
||||||
@@ -2769,7 +2769,7 @@ status_hilite_linestr_gather()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
char *
|
STATIC_OVL char *
|
||||||
status_hilite2str(hl)
|
status_hilite2str(hl)
|
||||||
struct hilite_s *hl;
|
struct hilite_s *hl;
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2567,7 +2567,7 @@ int final;
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* attributes: intrinsics and the like, other non-obvious capabilities */
|
/* attributes: intrinsics and the like, other non-obvious capabilities */
|
||||||
void
|
STATIC_OVL void
|
||||||
attributes_enlightenment(unused_mode, final)
|
attributes_enlightenment(unused_mode, final)
|
||||||
int unused_mode UNUSED;
|
int unused_mode UNUSED;
|
||||||
int final;
|
int final;
|
||||||
|
|||||||
+1
-1
@@ -897,7 +897,7 @@ xchar x, y;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
STATIC_OVL int
|
||||||
tether_glyph(x, y)
|
tether_glyph(x, y)
|
||||||
int x, y;
|
int x, y;
|
||||||
{
|
{
|
||||||
|
|||||||
+2
-2
@@ -1341,7 +1341,7 @@ domove()
|
|||||||
g.domove_attempting = 0L;
|
g.domove_attempting = 0L;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
STATIC_OVL void
|
||||||
domove_core()
|
domove_core()
|
||||||
{
|
{
|
||||||
register struct monst *mtmp;
|
register struct monst *mtmp;
|
||||||
@@ -1939,7 +1939,7 @@ domove_core()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
STATIC_OVL void
|
||||||
maybe_smudge_engr(x1,y1,x2,y2)
|
maybe_smudge_engr(x1,y1,x2,y2)
|
||||||
int x1, y1, x2, y2;
|
int x1, y1, x2, y2;
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -19,7 +19,9 @@
|
|||||||
#define ISAAC64_MASK ((uint64_t)0xFFFFFFFFFFFFFFFFULL)
|
#define ISAAC64_MASK ((uint64_t)0xFFFFFFFFFFFFFFFFULL)
|
||||||
|
|
||||||
#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L)
|
#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L)
|
||||||
|
#if !defined(HAS_INLINE)
|
||||||
#define HAS_INLINE
|
#define HAS_INLINE
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
# if (defined(__GNUC__) && __GNUC__ >= 2 && !defined(inline))
|
# if (defined(__GNUC__) && __GNUC__ >= 2 && !defined(inline))
|
||||||
# define inline __inline__
|
# define inline __inline__
|
||||||
|
|||||||
+1
-1
@@ -1033,7 +1033,7 @@ newmextra()
|
|||||||
return mextra;
|
return mextra;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean
|
STATIC_OVL boolean
|
||||||
makemon_rnd_goodpos(mon, gpflags, cc)
|
makemon_rnd_goodpos(mon, gpflags, cc)
|
||||||
struct monst *mon;
|
struct monst *mon;
|
||||||
unsigned gpflags;
|
unsigned gpflags;
|
||||||
|
|||||||
+4
-4
@@ -613,7 +613,7 @@ fixup_special()
|
|||||||
g.num_lregions = 0;
|
g.num_lregions = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
STATIC_OVL void
|
||||||
check_ransacked(s)
|
check_ransacked(s)
|
||||||
char *s;
|
char *s;
|
||||||
{
|
{
|
||||||
@@ -624,7 +624,7 @@ char *s;
|
|||||||
#define ORC_LEADER 1
|
#define ORC_LEADER 1
|
||||||
static const char *orcfruit[] = { "paddle cactus", "dwarven root" };
|
static const char *orcfruit[] = { "paddle cactus", "dwarven root" };
|
||||||
|
|
||||||
void
|
STATIC_OVL void
|
||||||
migrate_orc(mtmp, mflags)
|
migrate_orc(mtmp, mflags)
|
||||||
struct monst *mtmp;
|
struct monst *mtmp;
|
||||||
unsigned long mflags;
|
unsigned long mflags;
|
||||||
@@ -689,7 +689,7 @@ struct monst *mtmp;
|
|||||||
add_to_minv(mtmp, otmp);
|
add_to_minv(mtmp, otmp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void
|
STATIC_OVL void
|
||||||
migr_booty_item(otyp, gang)
|
migr_booty_item(otyp, gang)
|
||||||
int otyp;
|
int otyp;
|
||||||
const char *gang;
|
const char *gang;
|
||||||
@@ -710,7 +710,7 @@ const char *gang;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
STATIC_OVL void
|
||||||
stolen_booty(VOID_ARGS)
|
stolen_booty(VOID_ARGS)
|
||||||
{
|
{
|
||||||
char *gang, gang_name[BUFSZ];
|
char *gang, gang_name[BUFSZ];
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ const char *warnings[] = {
|
|||||||
#endif /* 0 */
|
#endif /* 0 */
|
||||||
|
|
||||||
|
|
||||||
void
|
STATIC_OVL void
|
||||||
sanity_check_single_mon(mtmp, chk_geno, msg)
|
sanity_check_single_mon(mtmp, chk_geno, msg)
|
||||||
struct monst *mtmp;
|
struct monst *mtmp;
|
||||||
boolean chk_geno;
|
boolean chk_geno;
|
||||||
@@ -2733,7 +2733,7 @@ struct monst *mtmp;
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
STATIC_OVL void
|
||||||
deal_with_overcrowding(mtmp)
|
deal_with_overcrowding(mtmp)
|
||||||
struct monst *mtmp;
|
struct monst *mtmp;
|
||||||
{
|
{
|
||||||
|
|||||||
+2
-2
@@ -411,7 +411,7 @@ struct obj *obj;
|
|||||||
return xname_flags(obj, CXN_NORMAL);
|
return xname_flags(obj, CXN_NORMAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
char *
|
STATIC_OVL char *
|
||||||
xname_flags(obj, cxn_flags)
|
xname_flags(obj, cxn_flags)
|
||||||
register struct obj *obj;
|
register struct obj *obj;
|
||||||
unsigned cxn_flags; /* bitmask of CXN_xxx values */
|
unsigned cxn_flags; /* bitmask of CXN_xxx values */
|
||||||
@@ -2570,7 +2570,7 @@ const char *oldstr;
|
|||||||
return bp;
|
return bp;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean
|
STATIC_OVL boolean
|
||||||
badman(basestr, to_plural)
|
badman(basestr, to_plural)
|
||||||
const char *basestr;
|
const char *basestr;
|
||||||
boolean to_plural; /* true => makeplural, false => makesingular */
|
boolean to_plural; /* true => makeplural, false => makesingular */
|
||||||
|
|||||||
+2
-2
@@ -1589,7 +1589,7 @@ int typ;
|
|||||||
return (char *) 0;
|
return (char *) 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
STATIC_OVL int
|
||||||
query_msgtype()
|
query_msgtype()
|
||||||
{
|
{
|
||||||
winid tmpwin;
|
winid tmpwin;
|
||||||
@@ -1783,7 +1783,7 @@ const char *errmsg;
|
|||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean
|
STATIC_OVL boolean
|
||||||
add_menu_coloring_parsed(str, c, a)
|
add_menu_coloring_parsed(str, c, a)
|
||||||
char *str;
|
char *str;
|
||||||
int c, a;
|
int c, a;
|
||||||
|
|||||||
+11
-11
@@ -1409,7 +1409,7 @@ static const char *suptext2[] = {
|
|||||||
(char *) 0,
|
(char *) 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
void
|
STATIC_OVL void
|
||||||
do_supplemental_info(name, pm, without_asking)
|
do_supplemental_info(name, pm, without_asking)
|
||||||
char *name;
|
char *name;
|
||||||
struct permonst *pm;
|
struct permonst *pm;
|
||||||
@@ -1885,61 +1885,61 @@ docontact(VOID_ARGS)
|
|||||||
destroy_nhwindow(cwin);
|
destroy_nhwindow(cwin);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
STATIC_OVL void
|
||||||
dispfile_help(VOID_ARGS)
|
dispfile_help(VOID_ARGS)
|
||||||
{
|
{
|
||||||
display_file(HELP, TRUE);
|
display_file(HELP, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
STATIC_OVL void
|
||||||
dispfile_shelp(VOID_ARGS)
|
dispfile_shelp(VOID_ARGS)
|
||||||
{
|
{
|
||||||
display_file(SHELP, TRUE);
|
display_file(SHELP, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
STATIC_OVL void
|
||||||
dispfile_optionfile(VOID_ARGS)
|
dispfile_optionfile(VOID_ARGS)
|
||||||
{
|
{
|
||||||
display_file(OPTIONFILE, TRUE);
|
display_file(OPTIONFILE, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
STATIC_OVL void
|
||||||
dispfile_license(VOID_ARGS)
|
dispfile_license(VOID_ARGS)
|
||||||
{
|
{
|
||||||
display_file(LICENSE, TRUE);
|
display_file(LICENSE, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
STATIC_OVL void
|
||||||
dispfile_debughelp(VOID_ARGS)
|
dispfile_debughelp(VOID_ARGS)
|
||||||
{
|
{
|
||||||
display_file(DEBUGHELP, TRUE);
|
display_file(DEBUGHELP, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
STATIC_OVL void
|
||||||
hmenu_doextversion(VOID_ARGS)
|
hmenu_doextversion(VOID_ARGS)
|
||||||
{
|
{
|
||||||
(void) doextversion();
|
(void) doextversion();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
STATIC_OVL void
|
||||||
hmenu_dohistory(VOID_ARGS)
|
hmenu_dohistory(VOID_ARGS)
|
||||||
{
|
{
|
||||||
(void) dohistory();
|
(void) dohistory();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
STATIC_OVL void
|
||||||
hmenu_dowhatis(VOID_ARGS)
|
hmenu_dowhatis(VOID_ARGS)
|
||||||
{
|
{
|
||||||
(void) dowhatis();
|
(void) dowhatis();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
STATIC_OVL void
|
||||||
hmenu_dowhatdoes(VOID_ARGS)
|
hmenu_dowhatdoes(VOID_ARGS)
|
||||||
{
|
{
|
||||||
(void) dowhatdoes();
|
(void) dowhatdoes();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
STATIC_OVL void
|
||||||
hmenu_doextlist(VOID_ARGS)
|
hmenu_doextlist(VOID_ARGS)
|
||||||
{
|
{
|
||||||
(void) doextlist();
|
(void) doextlist();
|
||||||
|
|||||||
+1
-1
@@ -1697,7 +1697,7 @@ int x, y;
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
STATIC_OVL int
|
||||||
do_loot_cont(cobjp, cindex, ccount)
|
do_loot_cont(cobjp, cindex, ccount)
|
||||||
struct obj **cobjp;
|
struct obj **cobjp;
|
||||||
int cindex, ccount; /* index of this container (1..N), number of them (N) */
|
int cindex, ccount; /* index of this container (1..N), number of them (N) */
|
||||||
|
|||||||
+17
@@ -572,4 +572,21 @@ VA_DECL(const char *, str)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* nhassert_failed is called when an nhassert's condition is false */
|
||||||
|
void
|
||||||
|
nhassert_failed(filepath, line)
|
||||||
|
const char * filepath;
|
||||||
|
int line;
|
||||||
|
{
|
||||||
|
const char * filename;
|
||||||
|
|
||||||
|
/* attempt to get filename from path. TODO: we really need a port provided
|
||||||
|
* function to return a filename from a path */
|
||||||
|
filename = strrchr(filepath, '/');
|
||||||
|
filename = (filename == NULL ? strrchr(filepath, '\\') : filename);
|
||||||
|
filename = (filename == NULL ? filepath : filename + 1);
|
||||||
|
|
||||||
|
impossible("nhassert failed in file '%s' at line %d", filename, line);
|
||||||
|
}
|
||||||
|
|
||||||
/*pline.c*/
|
/*pline.c*/
|
||||||
|
|||||||
+1
-1
@@ -569,7 +569,7 @@ int how;
|
|||||||
putmsghistory(out_line, FALSE);
|
putmsghistory(out_line, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean
|
STATIC_OVL boolean
|
||||||
skip_pager(common)
|
skip_pager(common)
|
||||||
boolean common;
|
boolean common;
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2719,7 +2719,7 @@ boolean ininv, dummy, silent;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
STATIC_OVL void
|
||||||
append_honorific(buf)
|
append_honorific(buf)
|
||||||
char *buf;
|
char *buf;
|
||||||
{
|
{
|
||||||
|
|||||||
+2
-2
@@ -1140,10 +1140,10 @@ struct monst *mtmp;
|
|||||||
sent out of his room (caller might resort to goodpos() if
|
sent out of his room (caller might resort to goodpos() if
|
||||||
we report failure here, so this isn't full prevention) */
|
we report failure here, so this isn't full prevention) */
|
||||||
if (mtmp->isshk && inhishop(mtmp)) {
|
if (mtmp->isshk && inhishop(mtmp)) {
|
||||||
if (levl[x][y].roomno != ESHK(mtmp)->shoproom)
|
if (levl[x][y].roomno != (unsigned char) ESHK(mtmp)->shoproom)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
} else if (mtmp->ispriest && inhistemple(mtmp)) {
|
} else if (mtmp->ispriest && inhistemple(mtmp)) {
|
||||||
if (levl[x][y].roomno != EPRI(mtmp)->shroom)
|
if (levl[x][y].roomno != (unsigned char) EPRI(mtmp)->shroom)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
/* current location is <xx,yy> */
|
/* current location is <xx,yy> */
|
||||||
|
|||||||
+17
-17
@@ -475,23 +475,6 @@ char *buf;
|
|||||||
}
|
}
|
||||||
#endif /* RUNTIME_PORT_ID */
|
#endif /* RUNTIME_PORT_ID */
|
||||||
|
|
||||||
/* nhassert_failed is called when an nhassert's condition is false */
|
|
||||||
void nhassert_failed(const char * exp, const char * file, int line)
|
|
||||||
{
|
|
||||||
char message[128];
|
|
||||||
_snprintf(message, sizeof(message),
|
|
||||||
"NHASSERT(%s) in '%s' at line %d\n", exp, file, line);
|
|
||||||
|
|
||||||
if (IsDebuggerPresent()) {
|
|
||||||
OutputDebugStringA(message);
|
|
||||||
DebugBreak();
|
|
||||||
}
|
|
||||||
|
|
||||||
// strip off the newline
|
|
||||||
message[strlen(message) - 1] = '\0';
|
|
||||||
error(message);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
nethack_exit(code)
|
nethack_exit(code)
|
||||||
int code;
|
int code;
|
||||||
@@ -725,6 +708,23 @@ sys_random_seed(VOID_ARGS)
|
|||||||
}
|
}
|
||||||
return ourseed;
|
return ourseed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* nt_assert_failed is called when an nhassert's condition is false */
|
||||||
|
void
|
||||||
|
nt_assert_failed(expression, filepath, line)
|
||||||
|
const char * expression;
|
||||||
|
const char * filepath;
|
||||||
|
int line;
|
||||||
|
{
|
||||||
|
const char * filename;
|
||||||
|
|
||||||
|
/* get file name from path */
|
||||||
|
filename = strrchr(filepath, '\\');
|
||||||
|
filename = (filename == NULL ? filepath : filename + 1);
|
||||||
|
impossible("nhassert(%s) failed in file '%s' at line %d",
|
||||||
|
expression, filename, line);
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* WIN32 */
|
#endif /* WIN32 */
|
||||||
|
|
||||||
/*winnt.c*/
|
/*winnt.c*/
|
||||||
|
|||||||
+2
-2
@@ -938,7 +938,7 @@ unsigned long old_rumor_offset;
|
|||||||
return rumor_offset;
|
return rumor_offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
do_rnd_access_file(fname)
|
do_rnd_access_file(fname)
|
||||||
const char *fname;
|
const char *fname;
|
||||||
{
|
{
|
||||||
@@ -1403,7 +1403,7 @@ do_date()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean
|
static boolean
|
||||||
get_gitinfo(githash, gitbranch)
|
get_gitinfo(githash, gitbranch)
|
||||||
char *githash, *gitbranch;
|
char *githash, *gitbranch;
|
||||||
{
|
{
|
||||||
|
|||||||
+20
-5
@@ -139,7 +139,7 @@ const char *str;
|
|||||||
putsyms(str);
|
putsyms(str);
|
||||||
cl_end();
|
cl_end();
|
||||||
ttyDisplay->toplin = TOPLINE_NEED_MORE;
|
ttyDisplay->toplin = TOPLINE_NEED_MORE;
|
||||||
if (ttyDisplay->cury && otoplin != 3)
|
if (ttyDisplay->cury && otoplin != TOPLINE_SPECIAL_PROMPT)
|
||||||
more();
|
more();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -204,12 +204,15 @@ more()
|
|||||||
{
|
{
|
||||||
struct WinDesc *cw = wins[WIN_MESSAGE];
|
struct WinDesc *cw = wins[WIN_MESSAGE];
|
||||||
|
|
||||||
/* avoid recursion -- only happens from interrupts */
|
|
||||||
if (ttyDisplay->inmore++)
|
|
||||||
return;
|
|
||||||
if (iflags.debug_fuzzer)
|
if (iflags.debug_fuzzer)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
/* avoid recursion -- only happens from interrupts */
|
||||||
|
if (ttyDisplay->inmore)
|
||||||
|
return;
|
||||||
|
|
||||||
|
ttyDisplay->inmore++;
|
||||||
|
|
||||||
if (ttyDisplay->toplin) {
|
if (ttyDisplay->toplin) {
|
||||||
tty_curs(BASE_WINDOW, cw->curx + 1, cw->cury);
|
tty_curs(BASE_WINDOW, cw->curx + 1, cw->cury);
|
||||||
if (cw->curx >= CO - 8)
|
if (cw->curx >= CO - 8)
|
||||||
@@ -256,7 +259,8 @@ register const char *bp;
|
|||||||
&& cw->cury == 0
|
&& cw->cury == 0
|
||||||
&& n0 + (int) strlen(g.toplines) + 3 < CO - 8 /* room for --More-- */
|
&& n0 + (int) strlen(g.toplines) + 3 < CO - 8 /* room for --More-- */
|
||||||
&& (notdied = strncmp(bp, "You die", 7)) != 0) {
|
&& (notdied = strncmp(bp, "You die", 7)) != 0) {
|
||||||
Strcat(g.toplines, " ");
|
nhassert((long) strlen(g.toplines) == cw->curx);
|
||||||
|
Strcat(toplines, " ");
|
||||||
Strcat(g.toplines, bp);
|
Strcat(g.toplines, bp);
|
||||||
cw->curx += 2;
|
cw->curx += 2;
|
||||||
if (!(cw->flags & WIN_STOP))
|
if (!(cw->flags & WIN_STOP))
|
||||||
@@ -309,6 +313,7 @@ char c;
|
|||||||
if (ttyDisplay->curx == 0 && ttyDisplay->cury > 0)
|
if (ttyDisplay->curx == 0 && ttyDisplay->cury > 0)
|
||||||
tty_curs(BASE_WINDOW, CO, (int) ttyDisplay->cury - 1);
|
tty_curs(BASE_WINDOW, CO, (int) ttyDisplay->cury - 1);
|
||||||
backsp();
|
backsp();
|
||||||
|
nhassert(ttyDisplay->curx > 0);
|
||||||
ttyDisplay->curx--;
|
ttyDisplay->curx--;
|
||||||
cw->curx = ttyDisplay->curx;
|
cw->curx = ttyDisplay->curx;
|
||||||
return;
|
return;
|
||||||
@@ -686,6 +691,13 @@ boolean restoring_msghist;
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (msg) {
|
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 */
|
/* move most recent message to history, make this become most recent */
|
||||||
remember_topl();
|
remember_topl();
|
||||||
Strcpy(g.toplines, msg);
|
Strcpy(g.toplines, msg);
|
||||||
@@ -693,6 +705,9 @@ boolean restoring_msghist;
|
|||||||
dumplogmsg(g.toplines);
|
dumplogmsg(g.toplines);
|
||||||
#endif
|
#endif
|
||||||
} else if (snapshot_mesgs) {
|
} else if (snapshot_mesgs) {
|
||||||
|
nhassert(ttyDisplay == NULL ||
|
||||||
|
ttyDisplay->toplin != TOPLINE_NEED_MORE);
|
||||||
|
|
||||||
/* done putting arbitrary messages in; put the snapshot ones back */
|
/* done putting arbitrary messages in; put the snapshot ones back */
|
||||||
for (idx = 0; snapshot_mesgs[idx]; ++idx) {
|
for (idx = 0; snapshot_mesgs[idx]; ++idx) {
|
||||||
remember_topl();
|
remember_topl();
|
||||||
|
|||||||
+4
-4
@@ -2319,7 +2319,7 @@ boolean blocking; /* with ttys, all windows are blocking */
|
|||||||
more();
|
more();
|
||||||
ttyDisplay->toplin = TOPLINE_NEED_MORE; /* more resets this */
|
ttyDisplay->toplin = TOPLINE_NEED_MORE; /* more resets this */
|
||||||
tty_clear_nhwindow(window);
|
tty_clear_nhwindow(window);
|
||||||
/* nhassert(ttyDisplay->toplin == TOPLINE_EMPTY); */
|
nhassert(ttyDisplay->toplin == TOPLINE_EMPTY);
|
||||||
} else
|
} else
|
||||||
ttyDisplay->toplin = TOPLINE_EMPTY;
|
ttyDisplay->toplin = TOPLINE_EMPTY;
|
||||||
cw->curx = cw->cury = 0;
|
cw->curx = cw->cury = 0;
|
||||||
@@ -2407,7 +2407,7 @@ winid window;
|
|||||||
case NHW_MESSAGE:
|
case NHW_MESSAGE:
|
||||||
if (ttyDisplay->toplin != TOPLINE_EMPTY)
|
if (ttyDisplay->toplin != TOPLINE_EMPTY)
|
||||||
tty_display_nhwindow(WIN_MESSAGE, TRUE);
|
tty_display_nhwindow(WIN_MESSAGE, TRUE);
|
||||||
/* nhassert(ttyDisplay->toplin == TOPLINE_EMPTY); */
|
nhassert(ttyDisplay->toplin == TOPLINE_EMPTY);
|
||||||
/*FALLTHRU*/
|
/*FALLTHRU*/
|
||||||
case NHW_STATUS:
|
case NHW_STATUS:
|
||||||
case NHW_BASE:
|
case NHW_BASE:
|
||||||
@@ -3162,7 +3162,7 @@ const char *mesg;
|
|||||||
more();
|
more();
|
||||||
ttyDisplay->toplin = TOPLINE_NEED_MORE; /* more resets this */
|
ttyDisplay->toplin = TOPLINE_NEED_MORE; /* more resets this */
|
||||||
tty_clear_nhwindow(WIN_MESSAGE);
|
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
|
/* normally <ESC> means skip further messages, but in this case
|
||||||
it means cancel the current prompt; any other messages should
|
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.
|
* must be updated because they need to change.
|
||||||
* This is now done at an individual field case-by-case level.
|
* This is now done at an individual field case-by-case level.
|
||||||
*/
|
*/
|
||||||
boolean
|
STATIC_OVL boolean
|
||||||
check_fields(forcefields, sz)
|
check_fields(forcefields, sz)
|
||||||
boolean forcefields;
|
boolean forcefields;
|
||||||
int sz[3];
|
int sz[3];
|
||||||
|
|||||||
Reference in New Issue
Block a user