Fix many compiler warnings.

There should only be two changes in behavior:

arogue7/fight.c, arogue7/fight.c: a to-hit bonus is now correctly
applied to characters who are not monks instead of monks who are not
empty-handed.

urogue/fight.c: fixed an interaction with the "debug" macro that could
cause the wrong message to be displayed.
This commit is contained in:
John "Elwin" Edwards 2021-04-14 18:55:33 -04:00
parent 6f21b5b88a
commit 6c3cd116ff
122 changed files with 374 additions and 280 deletions

View file

@ -203,7 +203,7 @@ command()
}
else
{
if (wizard = passwd())
if ( (wizard = passwd()) )
{
msg("You are suddenly as smart as Ken Arnold in dungeon #%d", dnum);
wizard = TRUE;

View file

@ -158,6 +158,7 @@ attack(struct thing *mp)
* Ants have poisonous bites
*/
if (!save(VS_POISON))
{
if (!ISWEARING(R_SUSTSTR))
{
chg_str(-1);
@ -167,10 +168,13 @@ attack(struct thing *mp)
msg("A sting has weakened you");
}
else
{
if (!terse)
msg("A sting momentarily weakens you");
else
msg("Sting has no effect");
}
}
when 'W':
/*
* Wraiths might drain energy levels

View file

@ -261,13 +261,13 @@ char *metal[] = {
int cNMETAL = NMETAL;
struct magic_item things[NUMTHINGS] = {
{ "", 27 }, /* potion */
{ "", 27 }, /* scroll */
{ "", 18 }, /* food */
{ "", 9 }, /* weapon */
{ "", 9 }, /* armor */
{ "", 5 }, /* ring */
{ "", 5 }, /* stick */
{ "", 27, 0 }, /* potion */
{ "", 27, 0 }, /* scroll */
{ "", 18, 0 }, /* food */
{ "", 9, 0 }, /* weapon */
{ "", 9, 0 }, /* armor */
{ "", 5, 0 }, /* ring */
{ "", 5, 0 }, /* stick */
};
struct magic_item s_magic[MAXSCROLLS] = {

View file

@ -419,9 +419,9 @@ playit()
int
too_much()
{
#ifdef MAXLOAD
double avec[3];
#ifdef MAXLOAD
if (md_loadav(avec) == 0)
return (avec[2] > (MAXLOAD / 10.0));
#endif

View file

@ -101,7 +101,7 @@ look(int wakeup)
*/
if (off(player, ISBLIND))
{
if (y == hero.y && x == hero.x
if ((y == hero.y && x == hero.x)
|| (inpass && (ch == '-' || ch == '|')))
continue;
}
@ -184,12 +184,15 @@ secretdoor(int y, int x)
cp.x = x;
cpp = &cp;
for (rp = rooms, i = 0; i < MAXROOMS; rp++, i++)
{
if (inroom(rp, cpp))
{
if (y == rp->r_pos.y || y == rp->r_pos.y + rp->r_max.y - 1)
return('-');
else
return('|');
}
}
return('p');
}

View file

@ -244,6 +244,7 @@ get_str(void *vopt, WINDOW *win)
continue;
}
else if (sp == buf)
{
if (c == '-')
break;
else if (c == '~')
@ -253,6 +254,7 @@ get_str(void *vopt, WINDOW *win)
sp += strlen(home);
continue;
}
}
if ((sp - buf) < 78) /* Avoid overflow */
{

View file

@ -79,6 +79,7 @@ add_pack(struct linked_list *item, int silent)
* Check for and deal with scare monster scrolls
*/
if (obj->o_type == SCROLL && obj->o_which == S_SCARE)
{
if (obj->o_flags & ISFOUND)
{
msg("The scroll turns to dust as you pick it up.");
@ -88,6 +89,7 @@ add_pack(struct linked_list *item, int silent)
}
else
obj->o_flags |= ISFOUND;
}
inpack++;
if (from_floor)

View file

@ -206,7 +206,10 @@ conn(int r1, int r2)
turn_spot = rnd(distance-1) + 1;
}
else
{
fatal("error in connection tables");
return;
}
/*
* Draw in the doors on either side of the passage or just put #'s
* if the rooms are gone.

View file

@ -192,10 +192,12 @@ score(int amount, int flags, int monst)
endwin();
}
if (wizard)
{
if (strcmp(prbuf, "names") == 0)
prflags = 1;
else if (strcmp(prbuf, "edit") == 0)
prflags = 2;
}
md_lockfile(outf);
@ -244,7 +246,7 @@ score(int amount, int flags, int monst)
printf("Top Ten Adventurers:\nRank\tScore\tName\n");
for (scp = top_ten; scp <= &top_ten[9]; scp++) {
if (scp->sc_score) {
printf("%d\t%d\t%s: %s on level %d", scp - top_ten + 1,
printf("%d\t%d\t%s: %s on level %d", (int) (scp - top_ten + 1),
scp->sc_score, scp->sc_name, reason[scp->sc_flags],
scp->sc_level);
if (scp->sc_flags == 0) {
@ -451,10 +453,12 @@ total_winner()
worth = r_magic[obj->o_which].mi_worth;
if (obj->o_which == R_ADDSTR || obj->o_which == R_ADDDAM ||
obj->o_which == R_PROTECT || obj->o_which == R_ADDHIT)
{
if (obj->o_ac > 0)
worth += obj->o_ac * 20;
else
worth = 50;
}
when STICK:
obj->o_flags |= ISKNOW;
ws_know[obj->o_which] = TRUE;

View file

@ -64,12 +64,6 @@
#define RSID_COORDLIST 0XABCD0016
#define RSID_ROOMS 0XABCD0017
#define READSTAT (format_error || read_error )
#define WRITESTAT (write_error)
static int read_error = FALSE;
static int write_error = FALSE;
static int format_error = FALSE;
static int endian = 0x01020304;
#define big_endian ( *((char *)&endian) == 0x01 )

View file

@ -174,10 +174,12 @@ fall(struct linked_list *item, int pr)
return;
}
if (pr)
{
if (obj->o_type == WEAPON) /* BUGFUX: Identification trick */
msg("Your %s vanishes as it hits the ground.", w_names[obj->o_which]);
else
msg("%s vanishes as it hits the ground.", inv_name(obj,TRUE));
}
discard(item);
}