Merge branch 'fix322' of https://github.com/entrez/NetHack into entrez-fix322
This commit is contained in:
+1
-1
@@ -162,6 +162,7 @@ E void FDECL(drop_upon_death, (struct monst *, struct obj *, int, int));
|
|||||||
E boolean NDECL(can_make_bones);
|
E boolean NDECL(can_make_bones);
|
||||||
E void FDECL(savebones, (int, time_t, struct obj *));
|
E void FDECL(savebones, (int, time_t, struct obj *));
|
||||||
E int NDECL(getbones);
|
E int NDECL(getbones);
|
||||||
|
E boolean FDECL(bones_include_name, (const char *));
|
||||||
|
|
||||||
/* ### botl.c ### */
|
/* ### botl.c ### */
|
||||||
|
|
||||||
@@ -1486,7 +1487,6 @@ E void NDECL(kill_genocided_monsters);
|
|||||||
E void FDECL(golemeffects, (struct monst *, int, int));
|
E void FDECL(golemeffects, (struct monst *, int, int));
|
||||||
E boolean FDECL(angry_guards, (BOOLEAN_P));
|
E boolean FDECL(angry_guards, (BOOLEAN_P));
|
||||||
E void NDECL(pacify_guards);
|
E void NDECL(pacify_guards);
|
||||||
E struct monst *FDECL(find_ghost_with_name, (char *));
|
|
||||||
E void FDECL(decide_to_shapeshift, (struct monst *, int));
|
E void FDECL(decide_to_shapeshift, (struct monst *, int));
|
||||||
E boolean FDECL(vamp_stone, (struct monst *));
|
E boolean FDECL(vamp_stone, (struct monst *));
|
||||||
|
|
||||||
|
|||||||
+23
@@ -656,4 +656,27 @@ getbones()
|
|||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* check whether current level contains bones from a particular player */
|
||||||
|
boolean
|
||||||
|
bones_include_name(name)
|
||||||
|
const char *name;
|
||||||
|
{
|
||||||
|
struct cemetery *bp;
|
||||||
|
int len;
|
||||||
|
char buf[BUFSZ];
|
||||||
|
|
||||||
|
/* prepare buffer by appending terminal hyphen to name, to avoid partial
|
||||||
|
* matches producing false positives */
|
||||||
|
Strcpy(buf, name);
|
||||||
|
Strcat(buf, "-");
|
||||||
|
len = strlen(buf);
|
||||||
|
|
||||||
|
for (bp = g.level.bonesinfo; bp; bp = bp->next) {
|
||||||
|
if (!strncmp(bp->who, buf, len))
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
/*bones.c*/
|
/*bones.c*/
|
||||||
|
|||||||
@@ -1473,7 +1473,7 @@ boolean at_stairs, falling, portal;
|
|||||||
mklev();
|
mklev();
|
||||||
new = TRUE; /* made the level */
|
new = TRUE; /* made the level */
|
||||||
|
|
||||||
familiar = (find_ghost_with_name(g.plname) != (struct monst *) 0);
|
familiar = bones_include_name(g.plname);
|
||||||
} else {
|
} else {
|
||||||
/* returning to previously visited level; reload it */
|
/* returning to previously visited level; reload it */
|
||||||
nhfp = open_levelfile(new_ledger, whynot);
|
nhfp = open_levelfile(new_ledger, whynot);
|
||||||
|
|||||||
@@ -4647,22 +4647,6 @@ pacify_guards()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct monst *
|
|
||||||
find_ghost_with_name(str)
|
|
||||||
char *str;
|
|
||||||
{
|
|
||||||
struct monst *mtmp;
|
|
||||||
|
|
||||||
for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
|
|
||||||
if (DEADMONSTER(mtmp)
|
|
||||||
|| mtmp->data != &mons[PM_GHOST] || !has_mgivenname(mtmp))
|
|
||||||
continue;
|
|
||||||
if (!strcmpi(MGIVENNAME(mtmp), str))
|
|
||||||
return mtmp;
|
|
||||||
}
|
|
||||||
return (struct monst *) 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
mimic_hit_msg(mtmp, otyp)
|
mimic_hit_msg(mtmp, otyp)
|
||||||
struct monst *mtmp;
|
struct monst *mtmp;
|
||||||
|
|||||||
Reference in New Issue
Block a user