mon name buffers
Follow suit with what <Someone> did for the object name buffers,
so that this sort of statement can work correctly:
pline("%s hits %s.", Monnam(mtmp), mon_nam(mtmp2));
This commit is contained in:
@@ -48,6 +48,7 @@ make it possible for the code to recognize your starting pet throughout the
|
|||||||
healers notice when a wand of undead turning revives a monster so the
|
healers notice when a wand of undead turning revives a monster so the
|
||||||
wand is then identified
|
wand is then identified
|
||||||
update display if bestowed a spellbook while unable to see invisible self
|
update display if bestowed a spellbook while unable to see invisible self
|
||||||
|
use small pool of static buffers for mon_nam() and Monnam()
|
||||||
|
|
||||||
|
|
||||||
Platform- and/or Interface-Specific Fixes
|
Platform- and/or Interface-Specific Fixes
|
||||||
|
|||||||
+16
-6
@@ -6,9 +6,23 @@
|
|||||||
|
|
||||||
STATIC_DCL void FDECL(do_oname, (struct obj *));
|
STATIC_DCL void FDECL(do_oname, (struct obj *));
|
||||||
STATIC_DCL void FDECL(getpos_help, (BOOLEAN_P,const char *));
|
STATIC_DCL void FDECL(getpos_help, (BOOLEAN_P,const char *));
|
||||||
|
STATIC_DCL char *NDECL(nextmbuf);
|
||||||
|
|
||||||
extern const char what_is_an_unknown_object[]; /* from pager.c */
|
extern const char what_is_an_unknown_object[]; /* from pager.c */
|
||||||
|
|
||||||
|
#define NUMMBUF 5
|
||||||
|
|
||||||
|
/* manage a pool of BUFSZ buffers, so callers don't have to */
|
||||||
|
STATIC_OVL char *
|
||||||
|
nextmbuf()
|
||||||
|
{
|
||||||
|
static char NEARDATA bufs[NUMMBUF][BUFSZ];
|
||||||
|
static int bufidx = 0;
|
||||||
|
|
||||||
|
bufidx = (bufidx + 1) % NUMMBUF;
|
||||||
|
return bufs[bufidx];
|
||||||
|
}
|
||||||
|
|
||||||
/* the response for '?' help request in getpos() */
|
/* the response for '?' help request in getpos() */
|
||||||
STATIC_OVL void
|
STATIC_OVL void
|
||||||
getpos_help(force, goal)
|
getpos_help(force, goal)
|
||||||
@@ -579,11 +593,7 @@ int suppress;
|
|||||||
*/
|
*/
|
||||||
boolean called;
|
boolean called;
|
||||||
{
|
{
|
||||||
#ifdef LINT /* static char buf[BUFSZ]; */
|
char *buf = nextmbuf();
|
||||||
char buf[BUFSZ];
|
|
||||||
#else
|
|
||||||
static char buf[BUFSZ];
|
|
||||||
#endif
|
|
||||||
struct permonst *mdat = mtmp->data;
|
struct permonst *mdat = mtmp->data;
|
||||||
boolean do_hallu, do_invis, do_it, do_saddle;
|
boolean do_hallu, do_invis, do_it, do_saddle;
|
||||||
boolean name_at_start, has_adjectives;
|
boolean name_at_start, has_adjectives;
|
||||||
@@ -606,7 +616,7 @@ boolean called;
|
|||||||
!(suppress & SUPPRESS_IT);
|
!(suppress & SUPPRESS_IT);
|
||||||
do_saddle = !(suppress & SUPPRESS_SADDLE);
|
do_saddle = !(suppress & SUPPRESS_SADDLE);
|
||||||
|
|
||||||
buf[0] = 0;
|
buf[0] = '\0';
|
||||||
|
|
||||||
/* unseen monsters, etc. Use "it" */
|
/* unseen monsters, etc. Use "it" */
|
||||||
if (do_it) {
|
if (do_it) {
|
||||||
|
|||||||
Reference in New Issue
Block a user