When looking at flying creatures, show their height (in metres).

This commit is contained in:
Rob Pearce 2016-06-01 15:18:52 +10:00
parent c4a576d6ca
commit cb97ac1f26
3 changed files with 4 additions and 3 deletions

2
defs.h
View File

@ -4185,7 +4185,7 @@ enum FLAG {
// lower chance of rare monsters
F_EXTRAMP, // lf has +v0 % extra maxmp
F_FEIGNINGDEATH, // lf is pretending to be dead
F_FLYING, // lf is flying. v0 = feet height
F_FLYING, // lf is flying. v0 = feet height (v0 / 2 = metres off the ground)
F_FASTACT, // modifier for action speed
F_FASTMETAB, // hunger counter increases faster, poison cures faster.
// v0 is multiplier.

4
io.c
View File

@ -847,10 +847,12 @@ cell_t *real_askcoords(char *prompt, char *subprompt, int targettype, lifeform_t
if (strlen(extrainfo)) strcat(extrainfo, ", ");
strcat(extrainfo, "prone");
} else if (isairborne(c->lf, &height)) {
double metres;
metres = ((double)height) / 2;
if (strlen(extrainfo)) strcat(extrainfo, ", ");
if (lfhasflag(c->lf, F_FLYING)) {
char fbuf[BUFLEN];
sprintf(fbuf, "flying:%d",height);
sprintf(fbuf, "flying:%0.2gm",metres);
strcat(extrainfo, fbuf);
} else if (lfhasflag(c->lf, F_LEVITATING)) {
strcat(extrainfo, "levitating");

View File

@ -13326,7 +13326,6 @@ int readsomething(lifeform_t *lf, object_t *o) {
// still reveal around it
setcellknownradius(destcell, PR_MASTER, 5, DT_ORTH);
needredraw = B_TRUE;
break;
}
} else {
getdisttext(lf->cell, destcell, distbuf, distbufbad, dirbuf);