outrip() updating (trunk only)

Part II of the bones tracking patch.  Change umpteen different outrip()
routines to handle its new time_t argument, and use formatkiller() instead
of directly accessing killer.{format,name} and killed_by_prefix[].  The
latter is now static within formatkiller().

     The many sys/* and win/* changes are untested....
This commit is contained in:
nethack.rankin
2012-01-24 04:26:33 +00:00
parent 9721470635
commit a871ad06e9
19 changed files with 80 additions and 172 deletions

View File

@@ -283,8 +283,6 @@ static NEARDATA const char *ends[] = { /* "when you..." */
static boolean Schroedingers_cat = FALSE;
extern const char * const killed_by_prefix[]; /* from topten.c */
/*ARGSUSED*/
void
done1(sig_unused) /* called as signal() handler, so sent at least one arg */
@@ -956,12 +954,9 @@ die:
urace.femalenum : urace.malenum;
}
corpse = mk_named_object(CORPSE, &mons[mnum],
u.ux, u.uy, plname);
Sprintf(pbuf, "%s, %s%s", plname,
killer.format == NO_KILLER_PREFIX ? "" :
killed_by_prefix[how],
killer.format == KILLED_BY_AN ? an(killer.name) :
killer.name);
u.ux, u.uy, plname);
Sprintf(pbuf, "%s, ", plname);
formatkiller(eos(pbuf), sizeof pbuf - strlen(pbuf), how);
make_grave(u.ux, u.uy, pbuf);
}
/* if pets will contribute to score, populate mydogs list now

View File

@@ -6,8 +6,6 @@
STATIC_DCL void FDECL(center, (int, char *));
extern const char * const killed_by_prefix[]; /* from topten.c */
#if defined(TTY_GRAPHICS) || defined(X11_GRAPHICS) || defined(GEM_GRAPHICS) || defined(MSWIN_GRAPHICS)
# define TEXT_TOMBSTONE
#endif

View File

@@ -73,12 +73,6 @@ STATIC_DCL void FDECL(nsb_mung_line,(char*));
STATIC_DCL void FDECL(nsb_unmung_line,(char*));
#endif
/* must fit with end.c; used in rip.c */
NEARDATA const char * const killed_by_prefix[] = {
"killed by ", "choked on ", "poisoned by ", "died of ", "drowned in ",
"burned by ", "dissolved in ", "crushed to death by ", "petrified by ",
"turned to slime by ", "killed by ", "", "", "", "", ""
};
static winid toptenwin = WIN_ERR;
@@ -89,6 +83,16 @@ char *buf;
unsigned siz;
int how;
{
static NEARDATA const char * const killed_by_prefix[] = {
/* DIED, CHOKING, POISONING, STARVING, */
"killed by ", "choked on ", "poisoned by ", "died of ",
/* DROWNING, BURNING, DISSOLVED, CRUSHING, */
"drowned in ", "burned by ", "dissolved in ", "crushed to death by ",
/* STONING, TURNED_SLIME, GENOCIDED, */
"petrified by ", "turned to slime by ", "killed by ",
/* PANICKED, TRICKED, QUIT, ESCAPED, ASCENDED */
"", "", "", "", ""
};
unsigned l;
char *kname = killer.name;