From cb97ac1f26c510a4046bd88da15a8808aed180c5 Mon Sep 17 00:00:00 2001 From: Rob Pearce Date: Wed, 1 Jun 2016 15:18:52 +1000 Subject: [PATCH] When looking at flying creatures, show their height (in metres). --- defs.h | 2 +- io.c | 4 +++- objects.c | 1 - 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/defs.h b/defs.h index ee513be..fad8235 100644 --- a/defs.h +++ b/defs.h @@ -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. diff --git a/io.c b/io.c index 62842cb..8a53d32 100644 --- a/io.c +++ b/io.c @@ -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"); diff --git a/objects.c b/objects.c index 369fe79..c59156a 100644 --- a/objects.c +++ b/objects.c @@ -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);