version 1.7 | | version 1.8 |
---|
| | |
/* | | /* |
* static char *rcsid_readable_c = | | * static char *rcsid_readable_c = |
* "$Id: readable.c,v 1.7 2001/05/29 04:41:53 mwedel Exp $"; | | * "$Id: readable.c,v 1.8 2001/10/30 00:49:02 michtoen Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
sprintf (buf, "%s The %s of %s", buf, name, art->item->name); | | sprintf (buf, "%s The %s of %s", buf, name, art->item->name); |
| | |
/* chance of finding */ | | /* chance of finding */ |
chance = 100 * ((float) art->chance / al->total_chance); | | chance = (int) ((float)100 * ((float) art->chance / (float)al->total_chance)); |
if (chance >= 20) | | if (chance >= 20) |
sprintf (sbuf, "an uncommon"); | | sprintf (sbuf, "an uncommon"); |
else if (chance >= 10) | | else if (chance >= 10) |
| | |
*/ | | */ |
do | | do |
{ | | { |
if ((spells[i].books || prayers) && spells[i].cleric == prayers | | if ((spells[i].books || prayers) && spells[i].cleric == (unsigned int) prayers |
&& (pnum & spells[i].path)) | | && (pnum & spells[i].path)) |
{ | | { |
/* book level determines max spell level to show | | /* book level determines max spell level to show |
| | |
strcat (retbuf, buf); | | strcat (retbuf, buf); |
level--; | | level--; |
} | | } |
if (strlen (retbuf) == introlen) | | if (strlen (retbuf) == (size_t) introlen) |
{ /* we got no information beyond the preamble! */ | | { /* we got no information beyond the preamble! */ |
strcat (retbuf, " [Unfortunately the rest of the information is\n"); | | strcat (retbuf, " [Unfortunately the rest of the information is\n"); |
strcat (retbuf, " hopelessly garbled!]\n ---\n"); | | strcat (retbuf, " hopelessly garbled!]\n ---\n"); |