follow-up: NetHack typically passes ptr to coord
This commit is contained in:
14
src/apply.c
14
src/apply.c
@@ -13,7 +13,7 @@ staticfn void use_whistle(struct obj *);
|
|||||||
staticfn void use_magic_whistle(struct obj *);
|
staticfn void use_magic_whistle(struct obj *);
|
||||||
staticfn void magic_whistled(struct obj *);
|
staticfn void magic_whistled(struct obj *);
|
||||||
staticfn int use_leash(struct obj *);
|
staticfn int use_leash(struct obj *);
|
||||||
staticfn void use_leash_core(struct obj *, struct monst *, coord, int);
|
staticfn void use_leash_core(struct obj *, struct monst *, coord *, int);
|
||||||
staticfn boolean mleashed_next2u(struct monst *);
|
staticfn boolean mleashed_next2u(struct monst *);
|
||||||
staticfn int use_mirror(struct obj *);
|
staticfn int use_mirror(struct obj *);
|
||||||
staticfn void use_bell(struct obj **);
|
staticfn void use_bell(struct obj **);
|
||||||
@@ -784,7 +784,7 @@ use_leash(struct obj *obj)
|
|||||||
if (u_at(cc.x, cc.y)) {
|
if (u_at(cc.x, cc.y)) {
|
||||||
if (u.usteed && u.dz > 0) {
|
if (u.usteed && u.dz > 0) {
|
||||||
mtmp = u.usteed;
|
mtmp = u.usteed;
|
||||||
use_leash_core(obj, mtmp, cc, 1);
|
use_leash_core(obj, mtmp, &cc, 1);
|
||||||
return ECMD_TIME;
|
return ECMD_TIME;
|
||||||
}
|
}
|
||||||
pline("Leash yourself? Very funny...");
|
pline("Leash yourself? Very funny...");
|
||||||
@@ -801,20 +801,20 @@ use_leash(struct obj *obj)
|
|||||||
return ECMD_TIME;
|
return ECMD_TIME;
|
||||||
}
|
}
|
||||||
|
|
||||||
use_leash_core(obj, mtmp, cc, canspotmon(mtmp));
|
use_leash_core(obj, mtmp, &cc, canspotmon(mtmp));
|
||||||
return ECMD_TIME;
|
return ECMD_TIME;
|
||||||
}
|
}
|
||||||
|
|
||||||
staticfn void
|
staticfn void
|
||||||
use_leash_core(struct obj *obj, struct monst *mtmp, coord cc, int spotmon)
|
use_leash_core(struct obj *obj, struct monst *mtmp, coord *cc, int spotmon)
|
||||||
{
|
{
|
||||||
if (!spotmon && !glyph_is_invisible(levl[cc.x][cc.y].glyph)) {
|
if (!spotmon && !glyph_is_invisible(levl[cc->x][cc->y].glyph)) {
|
||||||
/* for the unleash case, we don't verify whether this unseen
|
/* for the unleash case, we don't verify whether this unseen
|
||||||
monster is the creature attached to the current leash */
|
monster is the creature attached to the current leash */
|
||||||
You("fail to %sleash something.", obj->leashmon ? "un" : "");
|
You("fail to %sleash something.", obj->leashmon ? "un" : "");
|
||||||
/* trying again will work provided the monster is tame
|
/* trying again will work provided the monster is tame
|
||||||
(and also that it doesn't change location by retry time) */
|
(and also that it doesn't change location by retry time) */
|
||||||
map_invisible(cc.x, cc.y);
|
map_invisible(cc->x, cc->y);
|
||||||
} else if (!mtmp->mtame) {
|
} else if (!mtmp->mtame) {
|
||||||
pline("%s %s leashed!", Monnam(mtmp),
|
pline("%s %s leashed!", Monnam(mtmp),
|
||||||
(!obj->leashmon) ? "cannot be" : "is not");
|
(!obj->leashmon) ? "cannot be" : "is not");
|
||||||
@@ -832,7 +832,7 @@ use_leash_core(struct obj *obj, struct monst *mtmp, coord cc, int spotmon)
|
|||||||
char lmonbuf[BUFSZ];
|
char lmonbuf[BUFSZ];
|
||||||
char *lmonnam = l_monnam(mtmp);
|
char *lmonnam = l_monnam(mtmp);
|
||||||
|
|
||||||
if (cc.x != mtmp->mx || cc.y != mtmp->my) {
|
if (cc->x != mtmp->mx || cc->y != mtmp->my) {
|
||||||
Sprintf(lmonbuf, "%s tail", s_suffix(lmonnam));
|
Sprintf(lmonbuf, "%s tail", s_suffix(lmonnam));
|
||||||
lmonnam = lmonbuf;
|
lmonnam = lmonbuf;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user