# HG changeset patch # User John "Elwin" Edwards # Date 1618440933 14400 # Node ID e52a8a7ad4c57b80e9b7d4ae586019ac878ca344 # Parent e06ebc40761538ff396c870c572496d693d823c4 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. diff -r e06ebc407615 -r e52a8a7ad4c5 arogue5/chase.c --- a/arogue5/chase.c Sat Mar 20 22:36:52 2021 -0400 +++ b/arogue5/chase.c Wed Apr 14 18:55:33 2021 -0400 @@ -65,7 +65,7 @@ /* Is it OK to move there? */ if (step_ok(y, x, NOMONST, tp) && - (!isatrap(mvwinch(cw, y, x)) || + (!isatrap(CCHAR( mvwinch(cw, y, x) )) || rnd(10) >= tp->t_stats.s_intel || on(*tp, ISFLY))) { /* OK, we can go here. But don't go there if diff -r e06ebc407615 -r e52a8a7ad4c5 arogue5/command.c --- a/arogue5/command.c Sat Mar 20 22:36:52 2021 -0400 +++ b/arogue5/command.c Wed Apr 14 18:55:33 2021 -0400 @@ -921,7 +921,7 @@ } else know = (bool *) 0; } - if ((obj->o_flags & ISPOST) || (know && know[obj->o_which]) && !mark) { + if ((obj->o_flags & ISPOST) || (know && know[obj->o_which] && !mark)) { msg("That has already been identified."); return; } diff -r e06ebc407615 -r e52a8a7ad4c5 arogue5/main.c --- a/arogue5/main.c Sat Mar 20 22:36:52 2021 -0400 +++ b/arogue5/main.c Wed Apr 14 18:55:33 2021 -0400 @@ -50,9 +50,11 @@ main(int argc, char *argv[], char *envp[]) { register char *env; +#ifndef SCOREFILE char *roguedir; roguedir = md_getroguedir(); +#endif md_init(); /* diff -r e06ebc407615 -r e52a8a7ad4c5 arogue5/mdport.c --- a/arogue5/mdport.c Sat Mar 20 22:36:52 2021 -0400 +++ b/arogue5/mdport.c Wed Apr 14 18:55:33 2021 -0400 @@ -112,7 +112,9 @@ # define SE exit_standout_mode #endif +#ifdef _WIN32 static int md_standout_mode = 0; +#endif void md_raw_standout(void) @@ -292,7 +294,9 @@ #endif if ( (h == NULL) || (*h == '\0') ) + { if ( (h = getenv("HOME")) == NULL ) + { if ( (h = getenv("HOMEDRIVE")) == NULL) h = ""; else @@ -303,6 +307,8 @@ if ( (h = getenv("HOMEPATH")) == NULL) h = ""; } + } + } len = strlen(homedir); @@ -375,7 +381,7 @@ */ setuid(getuid()); setgid(getgid()); - execl(sh == NULL ? "/bin/sh" : sh, "shell", "-i", 0); + execl(sh == NULL ? "/bin/sh" : sh, "shell", "-i", (char *) NULL); perror("No shelly"); _exit(-1); } diff -r e06ebc407615 -r e52a8a7ad4c5 arogue5/misc.c --- a/arogue5/misc.c Sat Mar 20 22:36:52 2021 -0400 +++ b/arogue5/misc.c Wed Apr 14 18:55:33 2021 -0400 @@ -447,10 +447,9 @@ { register struct object *obj = NULL; register struct linked_list *item = NULL; - bool cursed, blessed, is_mm; + bool is_mm; char buf[LINELEN]; - cursed = FALSE; is_mm = FALSE; if (which < 0) { /* A real miscellaneous magic item */ @@ -463,8 +462,6 @@ return; obj = OBJPTR(item); - cursed = (obj->o_flags & ISCURSED) != 0; - blessed = (obj->o_flags & ISBLESSED) != 0; which = obj->o_which; } diff -r e06ebc407615 -r e52a8a7ad4c5 arogue5/monsters.c --- a/arogue5/monsters.c Sat Mar 20 22:36:52 2021 -0400 +++ b/arogue5/monsters.c Wed Apr 14 18:55:33 2021 -0400 @@ -730,14 +730,12 @@ register struct room *trp; register const char *mname; bool nasty; /* Will the monster "attack"? */ - char ch; if ((it = find_mons(y, x)) == NULL) { msg("Can't find monster in show"); return (NULL); } tp = THINGPTR(it); - ch = tp->t_type; trp = roomin(&tp->t_pos); /* Current room for monster */ mname = monsters[tp->t_index].m_name; diff -r e06ebc407615 -r e52a8a7ad4c5 arogue5/move.c --- a/arogue5/move.c Sat Mar 20 22:36:52 2021 -0400 +++ b/arogue5/move.c Wed Apr 14 18:55:33 2021 -0400 @@ -1339,7 +1339,7 @@ else if (isalpha(ch)) { if ((it = find_mons(y, x)) == NULL) { msg("Can't find monster in show"); - return(mvwinch(stdscr, y, x)); + return(CCHAR( mvwinch(stdscr, y, x) )); } tp = THINGPTR(it); diff -r e06ebc407615 -r e52a8a7ad4c5 arogue5/options.c --- a/arogue5/options.c Sat Mar 20 22:36:52 2021 -0400 +++ b/arogue5/options.c Wed Apr 14 18:55:33 2021 -0400 @@ -267,6 +267,7 @@ continue; } else if (sp == buf) + { if (c == '-' && win == hw) /* To move back a line in hw */ break; else if (c == '~') @@ -276,6 +277,7 @@ sp += strlen(home); continue; } + } *sp++ = c; waddstr(win, unctrl(c)); } @@ -326,6 +328,7 @@ { waddstr(hw, op->o_prompt); if ((retval = (*op->o_getfunc)(op->o_opt, hw))) + { if (retval == QUIT) break; else if (op > optlist) { /* MINUS */ @@ -338,6 +341,7 @@ wmove(hw, 0, 0); op--; } + } } /* * Switch back to original screen diff -r e06ebc407615 -r e52a8a7ad4c5 arogue5/passages.c --- a/arogue5/passages.c Sat Mar 20 22:36:52 2021 -0400 +++ b/arogue5/passages.c Wed Apr 14 18:55:33 2021 -0400 @@ -139,7 +139,7 @@ conn(int r1, int r2) { register struct room *rpf, *rpt = NULL; - register char rmt; + register signed char rmt; register int distance = 0, turn_spot = 0, turn_distance = 0; register int rm; register char direc; diff -r e06ebc407615 -r e52a8a7ad4c5 arogue5/player.c --- a/arogue5/player.c Sat Mar 20 22:36:52 2021 -0400 +++ b/arogue5/player.c Wed Apr 14 18:55:33 2021 -0400 @@ -522,7 +522,7 @@ if ((item = find_mons(new_pos.y, new_pos.x)) == NULL) debug("Steal from what @ %d,%d?", new_pos.y, new_pos.x); tp = THINGPTR(item); - if (isinvisible = invisible(tp)) mname = "creature"; + if ( (isinvisible = invisible(tp)) ) mname = "creature"; else mname = monsters[tp->t_index].m_name; /* Can player steal something unnoticed? */ diff -r e06ebc407615 -r e52a8a7ad4c5 arogue5/rip.c --- a/arogue5/rip.c Sat Mar 20 22:36:52 2021 -0400 +++ b/arogue5/rip.c Wed Apr 14 18:55:33 2021 -0400 @@ -511,7 +511,7 @@ /* Make sure we have an in-bound reason */ if (scp->sc_flgs > REASONLEN) scp->sc_flgs = REASONLEN; - printf("%3d %10lu\t%s (%s)", scp - top_ten + 1, + printf("%3d %10lu\t%s (%s)", (int) (scp - top_ten + 1), scp->sc_score, scp->sc_name, class); if (prflags == REALLIFE) printf(" [in real life %.*s!%.*s]", diff -r e06ebc407615 -r e52a8a7ad4c5 arogue5/save.c --- a/arogue5/save.c Sat Mar 20 22:36:52 2021 -0400 +++ b/arogue5/save.c Wed Apr 14 18:55:33 2021 -0400 @@ -128,8 +128,6 @@ save_file(FILE *savef) { int ret; - int slines = LINES; - int scols = COLS; wmove(cw, LINES-1, 0); draw(cw); diff -r e06ebc407615 -r e52a8a7ad4c5 arogue5/state.c --- a/arogue5/state.c Sat Mar 20 22:36:52 2021 -0400 +++ b/arogue5/state.c Wed Apr 14 18:55:33 2021 -0400 @@ -1318,7 +1318,7 @@ int rs_read_sticks(FILE *inf) { - int i = 0, j = 0, list = 0; + int i = 0, list = 0; if (read_error || format_error) return(READSTAT); @@ -1645,7 +1645,7 @@ int rs_read_room(FILE *inf, struct room *r) { - int value = 0, n = 0, i = 0, index = 0, id = 0; + int i = 0, index = 0; struct linked_list *fires=NULL, *item = NULL; if (read_error || format_error) diff -r e06ebc407615 -r e52a8a7ad4c5 arogue5/sticks.c --- a/arogue5/sticks.c Sat Mar 20 22:36:52 2021 -0400 +++ b/arogue5/sticks.c Wed Apr 14 18:55:33 2021 -0400 @@ -154,7 +154,7 @@ y = hero.y; x = hero.x; - while (shoot_ok(winat(y, x))) { + while (shoot_ok(CCHAR( winat(y, x) ))) { y += delta.y; x += delta.x; } @@ -331,7 +331,7 @@ case WS_SLOW_M: y = hero.y; x = hero.x; - while (shoot_ok(winat(y, x))) { + while (shoot_ok(CCHAR( winat(y, x) ))) { y += delta.y; x += delta.x; } @@ -453,7 +453,7 @@ else { y = hero.y; x = hero.x; - while (shoot_ok(winat(y, x))) + while (shoot_ok(CCHAR( winat(y, x) ))) { y += delta.y; x += delta.x; @@ -477,7 +477,7 @@ else { y = hero.y; x = hero.x; - while (shoot_ok(winat(y, x))) + while (shoot_ok(CCHAR( winat(y, x) ))) { y += delta.y; x += delta.x; @@ -497,7 +497,7 @@ when WS_FEAR: y = hero.y; x = hero.x; - while (shoot_ok(winat(y, x))) + while (shoot_ok(CCHAR( winat(y, x) ))) { y += delta.y; x += delta.x; @@ -530,7 +530,7 @@ when WS_MDEG: y = hero.y; x = hero.x; - while (shoot_ok(winat(y, x))) + while (shoot_ok(CCHAR( winat(y, x) ))) { y += delta.y; x += delta.x; @@ -558,7 +558,7 @@ when WS_DISINTEGRATE: y = hero.y; x = hero.x; - while (shoot_ok(winat(y, x))) { + while (shoot_ok(CCHAR( winat(y, x) ))) { y += delta.y; x += delta.x; } diff -r e06ebc407615 -r e52a8a7ad4c5 arogue5/util.c --- a/arogue5/util.c Sat Mar 20 22:36:52 2021 -0400 +++ b/arogue5/util.c Wed Apr 14 18:55:33 2021 -0400 @@ -624,7 +624,7 @@ */ if (off(player, ISBLIND)) { - if (y == hero.y && x == hero.x + if ((y == hero.y && x == hero.x) || (inpass && (ch == '-' || ch == '|'))) continue; @@ -825,10 +825,12 @@ 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'); } diff -r e06ebc407615 -r e52a8a7ad4c5 arogue5/wizard.c --- a/arogue5/wizard.c Sat Mar 20 22:36:52 2021 -0400 +++ b/arogue5/wizard.c Wed Apr 14 18:55:33 2021 -0400 @@ -30,7 +30,8 @@ reg struct linked_list *item; reg struct object *obj; reg int wh; - reg char ch, newitem, newtype = 0, whc, msz, *pt; + reg char ch, newitem, newtype = 0, msz, *pt; + signed char whc; WINDOW *thiswin; thiswin = cw; diff -r e06ebc407615 -r e52a8a7ad4c5 arogue5/xcrypt.c --- a/arogue5/xcrypt.c Sat Mar 20 22:36:52 2021 -0400 +++ b/arogue5/xcrypt.c Wed Apr 14 18:55:33 2021 -0400 @@ -601,7 +601,7 @@ if ((*q++ = *key << 1)) key++; } - if (des_setkey((unsigned char *) keybuf)) + if (des_setkey((char *) keybuf)) return(NULL); if (*setting == _PASSWORD_EFMT1) { @@ -620,7 +620,7 @@ /* * Encrypt the key with itself. */ - if (des_cipher((unsigned char*)keybuf, (unsigned char*)keybuf, 0, 1)) + if (des_cipher((char*)keybuf, (char*)keybuf, 0, 1)) return(NULL); /* * And XOR with the next 8 characters of the key. @@ -630,7 +630,7 @@ *key) *q++ ^= *key++ << 1; - if (des_setkey((unsigned char *) keybuf)) + if (des_setkey((char *) keybuf)) return(NULL); } strncpy((char *)output, setting, 9); diff -r e06ebc407615 -r e52a8a7ad4c5 arogue7/chase.c --- a/arogue7/chase.c Sat Mar 20 22:36:52 2021 -0400 +++ b/arogue7/chase.c Wed Apr 14 18:55:33 2021 -0400 @@ -65,7 +65,7 @@ /* Is it OK to move there? */ if (step_ok(y, x, NOMONST, tp) && - (!isatrap(mvwinch(cw, y, x)) || + (!isatrap(CCHAR( mvwinch(cw, y, x) )) || rnd(10) >= tp->t_stats.s_intel || on(*tp, ISFLY))) { /* OK, we can go here. But don't go there if diff -r e06ebc407615 -r e52a8a7ad4c5 arogue7/command.c --- a/arogue7/command.c Sat Mar 20 22:36:52 2021 -0400 +++ b/arogue7/command.c Wed Apr 14 18:55:33 2021 -0400 @@ -1032,12 +1032,9 @@ void shell(void) { - register char *sh; - /* * Set the terminal back to original mode */ - sh = getenv("SHELL"); wclear(hw); wmove(hw, lines-1, 0); draw(hw); @@ -1138,7 +1135,7 @@ } else know = (bool *) 0; } - if ((obj->o_flags & ISPOST) || (know && know[obj->o_which]) && !mark) { + if ((obj->o_flags & ISPOST) || (know && know[obj->o_which] && !mark)) { msg("That has already been identified."); return; } diff -r e06ebc407615 -r e52a8a7ad4c5 arogue7/fight.c --- a/arogue7/fight.c Sat Mar 20 22:36:52 2021 -0400 +++ b/arogue7/fight.c Wed Apr 14 18:55:33 2021 -0400 @@ -515,9 +515,11 @@ } else if (att == &pstats) { /* Player attacks monster */ def_arm = def->s_arm - dext_prot(def->s_dext); - if (player.t_ctype == C_MONK) /* no strength bonus for monk */ + if (player.t_ctype == C_MONK) { + /* no strength bonus for monk */ if (weap == NULL) hplus += att->s_lvl/5; /* monks hplus varies with level */ + } else hplus += str_plus(str_compute())+dext_plus(dex_compute()); } diff -r e06ebc407615 -r e52a8a7ad4c5 arogue7/init.c --- a/arogue7/init.c Sat Mar 20 22:36:52 2021 -0400 +++ b/arogue7/init.c Wed Apr 14 18:55:33 2021 -0400 @@ -19,6 +19,7 @@ #include "curses.h" #include +#include #include #include "rogue.h" #include "mach_dep.h" @@ -293,12 +294,15 @@ void init_player(void) { - int stat_total, round, minimum, maximum, ch, i, j; + int stat_total, round, minimum, maximum, ch, i; short do_escape, *our_stats[NUMABILITIES-1]; +#ifdef WIZARD + int j; struct linked_list *weap_item, *armor_item; struct object *obj; weap_item = armor_item = NULL; +#endif if (char_type == -1) { /* See what type character will be */ diff -r e06ebc407615 -r e52a8a7ad4c5 arogue7/mdport.c --- a/arogue7/mdport.c Sat Mar 20 22:36:52 2021 -0400 +++ b/arogue7/mdport.c Wed Apr 14 18:55:33 2021 -0400 @@ -109,7 +109,9 @@ # define SE exit_standout_mode #endif +#ifdef _WIN32 static int md_standout_mode = 0; +#endif void md_raw_standout(void) @@ -297,7 +299,9 @@ #endif if ( (h == NULL) || (*h == '\0') ) + { if ( (h = getenv("HOME")) == NULL ) + { if ( (h = getenv("HOMEDRIVE")) == NULL) h = ""; else @@ -308,6 +312,8 @@ if ( (h = getenv("HOMEPATH")) == NULL) h = ""; } + } + } len = strlen(homedir); @@ -378,7 +384,7 @@ */ setuid(getuid()); setgid(getgid()); - execl(sh == NULL ? "/bin/sh" : sh, "shell", "-i", 0); + execl(sh == NULL ? "/bin/sh" : sh, "shell", "-i", (char *) NULL); perror("No shelly"); _exit(-1); } diff -r e06ebc407615 -r e52a8a7ad4c5 arogue7/misc.c --- a/arogue7/misc.c Sat Mar 20 22:36:52 2021 -0400 +++ b/arogue7/misc.c Wed Apr 14 18:55:33 2021 -0400 @@ -843,9 +843,8 @@ { register struct object *obj = NULL; register struct linked_list *item = NULL; - bool cursed, blessed, is_mm; + bool is_mm; - cursed = FALSE; is_mm = FALSE; if (which < 0) { /* A real miscellaneous magic item */ @@ -878,8 +877,6 @@ is_mm = TRUE; obj = OBJPTR(item); - cursed = (obj->o_flags & ISCURSED) != 0; - blessed = (obj->o_flags & ISBLESSED) != 0; which = obj->o_which; } diff -r e06ebc407615 -r e52a8a7ad4c5 arogue7/move.c --- a/arogue7/move.c Sat Mar 20 22:36:52 2021 -0400 +++ b/arogue7/move.c Wed Apr 14 18:55:33 2021 -0400 @@ -1752,7 +1752,7 @@ else if (isalpha(ch)) { if ((it = find_mons(y, x)) == NULL) { msg("Show: Can't find monster in show (%d, %d)", y, x); - return(mvwinch(stdscr, y, x)); + return(CCHAR( mvwinch(stdscr, y, x) )); } tp = THINGPTR(it); diff -r e06ebc407615 -r e52a8a7ad4c5 arogue7/options.c --- a/arogue7/options.c Sat Mar 20 22:36:52 2021 -0400 +++ b/arogue7/options.c Wed Apr 14 18:55:33 2021 -0400 @@ -240,6 +240,7 @@ continue; } else if (sp == buf) + { if (c == '-' && win == hw) /* To move back a line in hw */ break; else if (c == '~') @@ -249,6 +250,7 @@ sp += strlen(home); continue; } + } *sp++ = c; waddstr(win, unctrl(c)); } @@ -299,6 +301,7 @@ { waddstr(hw, op->o_prompt); if ((retval = (*op->o_getfunc)(op->o_opt, hw))) + { if (retval == QUIT) break; else if (op > optlist) { /* MINUS */ @@ -311,6 +314,7 @@ wmove(hw, 0, 0); op--; } + } } /* * Switch back to original screen diff -r e06ebc407615 -r e52a8a7ad4c5 arogue7/passages.c --- a/arogue7/passages.c Sat Mar 20 22:36:52 2021 -0400 +++ b/arogue7/passages.c Wed Apr 14 18:55:33 2021 -0400 @@ -143,7 +143,7 @@ conn(int r1, int r2) { register struct room *rpf, *rpt = NULL; - register char rmt; + register signed char rmt; register int distance, max_diag, offset, i; register int rm; int turns[3], turn_dist[3]; diff -r e06ebc407615 -r e52a8a7ad4c5 arogue7/player.c --- a/arogue7/player.c Sat Mar 20 22:36:52 2021 -0400 +++ b/arogue7/player.c Wed Apr 14 18:55:33 2021 -0400 @@ -500,7 +500,7 @@ msg ("You can't steal from stone!"); return; } - if (isinvisible = invisible(tp)) mname = "creature"; + if ( (isinvisible = invisible(tp)) ) mname = "creature"; else mname = monster_name(tp); /* Can player steal something unnoticed? */ diff -r e06ebc407615 -r e52a8a7ad4c5 arogue7/rip.c --- a/arogue7/rip.c Sat Mar 20 22:36:52 2021 -0400 +++ b/arogue7/rip.c Wed Apr 14 18:55:33 2021 -0400 @@ -580,7 +580,7 @@ /* Make sure we have an in-bound reason */ if (scp->sc_flags > REASONLEN) scp->sc_flags = REASONLEN; - printf("%3d %10lu\t%s (%s)", scp - top_ten + 1, + printf("%3d %10lu\t%s (%s)", (int) (scp - top_ten + 1), scp->sc_score, scp->sc_name, class); if (prflags == REALLIFE) printf(" [in real life %.*s!%.*s]", diff -r e06ebc407615 -r e52a8a7ad4c5 arogue7/scrolls.c --- a/arogue7/scrolls.c Sat Mar 20 22:36:52 2021 -0400 +++ b/arogue7/scrolls.c Wed Apr 14 18:55:33 2021 -0400 @@ -32,9 +32,6 @@ register struct linked_list *ip; register struct thing *mp; register struct linked_list *nip; - register int num_monst = NUMMONST-NUMUNIQUE-1, /* cannot genocide uniques */ - pres_monst=1, - num_lines=2*(lines-3); register int which_monst; which_monst = makemonster(FALSE, "Genocide", "wipe out"); diff -r e06ebc407615 -r e52a8a7ad4c5 arogue7/state.c --- a/arogue7/state.c Sat Mar 20 22:36:52 2021 -0400 +++ b/arogue7/state.c Wed Apr 14 18:55:33 2021 -0400 @@ -1366,7 +1366,7 @@ int rs_read_sticks(FILE *inf) { - int i = 0, j = 0, list = 0; + int i = 0, list = 0; if (read_error || format_error) return(READSTAT); @@ -1776,7 +1776,7 @@ int rs_read_room(FILE *inf, struct room *r) { - int value = 0, n = 0, i = 0, index = 0, id = 0; + int i = 0, index = 0; struct linked_list *fires=NULL, *item = NULL; if (read_error || format_error) diff -r e06ebc407615 -r e52a8a7ad4c5 arogue7/sticks.c --- a/arogue7/sticks.c Sat Mar 20 22:36:52 2021 -0400 +++ b/arogue7/sticks.c Wed Apr 14 18:55:33 2021 -0400 @@ -91,7 +91,8 @@ y += direction->y; x += direction->x; } - while (shoot_ok(winat(y, x)) && !(y == hero.y && x == hero.x)); + while (shoot_ok(CCHAR( winat(y, x)) ) && + !(y == hero.y && x == hero.x)); if (y == hero.y && x == hero.x) is_player = TRUE; diff -r e06ebc407615 -r e52a8a7ad4c5 arogue7/util.c --- a/arogue7/util.c Sat Mar 20 22:36:52 2021 -0400 +++ b/arogue7/util.c Wed Apr 14 18:55:33 2021 -0400 @@ -583,7 +583,7 @@ else if (on(player, ISFLEE)) { y = hero.y; x = hero.x; - while (shoot_ok(winat(y, x))) { + while (shoot_ok(CCHAR( winat(y, x) ))) { y += direction->y; x += direction->x; } @@ -821,7 +821,7 @@ */ if (off(player, ISBLIND)) { - if (y == hero.y && x == hero.x + if ((y == hero.y && x == hero.x) || (inpass && (ch == '-' || ch == '|'))) continue; @@ -1150,10 +1150,12 @@ 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'); } diff -r e06ebc407615 -r e52a8a7ad4c5 arogue7/wizard.c --- a/arogue7/wizard.c Sat Mar 20 22:36:52 2021 -0400 +++ b/arogue7/wizard.c Wed Apr 14 18:55:33 2021 -0400 @@ -38,7 +38,8 @@ reg struct linked_list *item; reg struct object *obj; reg int wh; - reg char ch, newitem, newtype, whc, msz, *pt; + reg char ch, newitem, newtype, msz, *pt; + signed char whc; WINDOW *thiswin; thiswin = cw; @@ -128,6 +129,7 @@ } if(msz == 1) { /* if only one type of item */ ch = 'a'; + newtype = 0; } else if (prompt) { register struct magic_item *wmi; diff -r e06ebc407615 -r e52a8a7ad4c5 arogue7/xcrypt.c --- a/arogue7/xcrypt.c Sat Mar 20 22:36:52 2021 -0400 +++ b/arogue7/xcrypt.c Wed Apr 14 18:55:33 2021 -0400 @@ -601,7 +601,7 @@ if ((*q++ = *key << 1)) key++; } - if (des_setkey((unsigned char *) keybuf)) + if (des_setkey((char *) keybuf)) return(NULL); if (*setting == _PASSWORD_EFMT1) { @@ -620,7 +620,7 @@ /* * Encrypt the key with itself. */ - if (des_cipher((unsigned char*)keybuf, (unsigned char*)keybuf, 0, 1)) + if (des_cipher((char*)keybuf, (char*)keybuf, 0, 1)) return(NULL); /* * And XOR with the next 8 characters of the key. @@ -630,7 +630,7 @@ *key) *q++ ^= *key++ << 1; - if (des_setkey((unsigned char *) keybuf)) + if (des_setkey((char *) keybuf)) return(NULL); } strncpy((char *)output, setting, 9); diff -r e06ebc407615 -r e52a8a7ad4c5 rogue3/command.c --- a/rogue3/command.c Sat Mar 20 22:36:52 2021 -0400 +++ b/rogue3/command.c Wed Apr 14 18:55:33 2021 -0400 @@ -203,7 +203,7 @@ } else { - if (wizard = passwd()) + if ( (wizard = passwd()) ) { msg("You are suddenly as smart as Ken Arnold in dungeon #%d", dnum); wizard = TRUE; diff -r e06ebc407615 -r e52a8a7ad4c5 rogue3/fight.c --- a/rogue3/fight.c Sat Mar 20 22:36:52 2021 -0400 +++ b/rogue3/fight.c Wed Apr 14 18:55:33 2021 -0400 @@ -158,6 +158,7 @@ * Ants have poisonous bites */ if (!save(VS_POISON)) + { if (!ISWEARING(R_SUSTSTR)) { chg_str(-1); @@ -167,10 +168,13 @@ 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 diff -r e06ebc407615 -r e52a8a7ad4c5 rogue3/init.c --- a/rogue3/init.c Sat Mar 20 22:36:52 2021 -0400 +++ b/rogue3/init.c Wed Apr 14 18:55:33 2021 -0400 @@ -261,13 +261,13 @@ 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] = { diff -r e06ebc407615 -r e52a8a7ad4c5 rogue3/main.c --- a/rogue3/main.c Sat Mar 20 22:36:52 2021 -0400 +++ b/rogue3/main.c Wed Apr 14 18:55:33 2021 -0400 @@ -419,9 +419,9 @@ int too_much() { +#ifdef MAXLOAD double avec[3]; -#ifdef MAXLOAD if (md_loadav(avec) == 0) return (avec[2] > (MAXLOAD / 10.0)); #endif diff -r e06ebc407615 -r e52a8a7ad4c5 rogue3/misc.c --- a/rogue3/misc.c Sat Mar 20 22:36:52 2021 -0400 +++ b/rogue3/misc.c Wed Apr 14 18:55:33 2021 -0400 @@ -101,7 +101,7 @@ */ 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 @@ 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'); } diff -r e06ebc407615 -r e52a8a7ad4c5 rogue3/options.c --- a/rogue3/options.c Sat Mar 20 22:36:52 2021 -0400 +++ b/rogue3/options.c Wed Apr 14 18:55:33 2021 -0400 @@ -244,6 +244,7 @@ continue; } else if (sp == buf) + { if (c == '-') break; else if (c == '~') @@ -253,6 +254,7 @@ sp += strlen(home); continue; } + } if ((sp - buf) < 78) /* Avoid overflow */ { diff -r e06ebc407615 -r e52a8a7ad4c5 rogue3/pack.c --- a/rogue3/pack.c Sat Mar 20 22:36:52 2021 -0400 +++ b/rogue3/pack.c Wed Apr 14 18:55:33 2021 -0400 @@ -79,6 +79,7 @@ * 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 @@ } else obj->o_flags |= ISFOUND; + } inpack++; if (from_floor) diff -r e06ebc407615 -r e52a8a7ad4c5 rogue3/passages.c --- a/rogue3/passages.c Sat Mar 20 22:36:52 2021 -0400 +++ b/rogue3/passages.c Wed Apr 14 18:55:33 2021 -0400 @@ -206,7 +206,10 @@ 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. diff -r e06ebc407615 -r e52a8a7ad4c5 rogue3/rip.c --- a/rogue3/rip.c Sat Mar 20 22:36:52 2021 -0400 +++ b/rogue3/rip.c Wed Apr 14 18:55:33 2021 -0400 @@ -192,10 +192,12 @@ 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 @@ 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 @@ 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; diff -r e06ebc407615 -r e52a8a7ad4c5 rogue3/state.c --- a/rogue3/state.c Sat Mar 20 22:36:52 2021 -0400 +++ b/rogue3/state.c Wed Apr 14 18:55:33 2021 -0400 @@ -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 ) diff -r e06ebc407615 -r e52a8a7ad4c5 rogue3/weapons.c --- a/rogue3/weapons.c Sat Mar 20 22:36:52 2021 -0400 +++ b/rogue3/weapons.c Wed Apr 14 18:55:33 2021 -0400 @@ -174,10 +174,12 @@ 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); } diff -r e06ebc407615 -r e52a8a7ad4c5 rogue4/chase.c --- a/rogue4/chase.c Sat Mar 20 22:36:52 2021 -0400 +++ b/rogue4/chase.c Wed Apr 14 18:55:33 2021 -0400 @@ -153,7 +153,7 @@ mvaddch(th->t_pos.y, th->t_pos.x, th->t_oldch); if (!ce(ch_ret, th->t_pos)) { - sch = mvinch(ch_ret.y, ch_ret.x); + sch = mvinch(ch_ret.y, ch_ret.x) & A_CHARTEXT; if (sch == FLOOR && (th->t_room->r_flags & ISDARK) && DISTANCE(th->t_pos.y, th->t_pos.x, hero.y, hero.x) && !on(player, ISBLIND)) diff -r e06ebc407615 -r e52a8a7ad4c5 rogue4/command.c --- a/rogue4/command.c Sat Mar 20 22:36:52 2021 -0400 +++ b/rogue4/command.c Wed Apr 14 18:55:33 2021 -0400 @@ -249,7 +249,7 @@ } else { - if (wizard = passwd()) + if ( (wizard = passwd()) ) { noscore = TRUE; turn_see(FALSE); diff -r e06ebc407615 -r e52a8a7ad4c5 rogue4/extern.h --- a/rogue4/extern.h Sat Mar 20 22:36:52 2021 -0400 +++ b/rogue4/extern.h Wed Apr 14 18:55:33 2021 -0400 @@ -59,9 +59,9 @@ long lseek(); extern coord ch_ret; -extern shint countch; -extern shint direction; -extern shint newcount; +extern char countch; +extern char direction; +extern char newcount; extern int between; extern int num_checks; extern char lvl_mons[27]; @@ -83,6 +83,7 @@ extern int md_fileno(FILE *fp); extern char *md_getusername(int uid); extern char *md_gethomedir(); +extern char *md_getpass(char *prompt); extern int md_getuid(void); extern void md_ignore_signals(void); extern void md_init(void); diff -r e06ebc407615 -r e52a8a7ad4c5 rogue4/fight.c --- a/rogue4/fight.c Sat Mar 20 22:36:52 2021 -0400 +++ b/rogue4/fight.c Wed Apr 14 18:55:33 2021 -0400 @@ -137,6 +137,7 @@ */ if (cur_armor != NULL && cur_armor->o_ac < 9 && cur_armor->o_which != LEATHER) + { if (ISWEARING(R_SUSTARM)) msg("The rust vanishes instantly"); else @@ -147,6 +148,7 @@ else msg("your armor weakens"); } + } when 'E': /* * The gaze of the floating eye hypnotizes you @@ -167,6 +169,7 @@ * Ants have poisonous bites */ if (!save(VS_POISON)) + { if (!ISWEARING(R_SUSTSTR)) { chg_str(-1); @@ -176,10 +179,13 @@ msg("a sting has weakened you"); } else + { if (!terse) msg("a sting momentarily weakens you"); else msg("sting has no effect"); + } + } when 'W': case 'V': /* diff -r e06ebc407615 -r e52a8a7ad4c5 rogue4/mdport.c --- a/rogue4/mdport.c Sat Mar 20 22:36:52 2021 -0400 +++ b/rogue4/mdport.c Wed Apr 14 18:55:33 2021 -0400 @@ -110,7 +110,9 @@ #endif } +#ifdef _WIN32 static int md_standout_mode = 0; +#endif void md_raw_standout(void) @@ -409,7 +411,7 @@ */ setuid(getuid()); setgid(getgid()); - execl(sh == NULL ? "/bin/sh" : sh, "shell", "-i", 0); + execl(sh == NULL ? "/bin/sh" : sh, "shell", "-i", (char *) NULL); perror("No shelly"); _exit(-1); } @@ -590,6 +592,7 @@ avg[0] = avg[1] = avg[2] = 0.0; return -1; } + return 3; } long diff -r e06ebc407615 -r e52a8a7ad4c5 rogue4/misc.c --- a/rogue4/misc.c Sat Mar 20 22:36:52 2021 -0400 +++ b/rogue4/misc.c Wed Apr 14 18:55:33 2021 -0400 @@ -58,9 +58,7 @@ register int passcount = 0; register char pfl, *fp, pch; register int sy, sx, sumhero = 0, diffhero = 0; - register int oldx, oldy; - getyx(stdscr, oldy, oldx); rp = proom; if (!ce(oldpos, hero)) { @@ -115,12 +113,15 @@ fp = &_flags[index]; ch = _level[index]; if (pch != DOOR && ch != DOOR) + { if ((pfl & F_PASS) != (*fp & F_PASS)) continue; else if ((*fp & F_PASS) && (*fp & F_PNUM) != (pfl & F_PNUM)) continue; + } if ((tp = _monst[index]) != NULL) + { if (on(player, SEEMONST) && on(*tp, ISINVIS)) { if (door_stop && !firstmove) @@ -137,6 +138,7 @@ if (see_monst(tp)) ch = tp->t_disguise; } + } move(y, x); if (ch != inch()) diff -r e06ebc407615 -r e52a8a7ad4c5 rogue4/monsters.c --- a/rogue4/monsters.c Sat Mar 20 22:36:52 2021 -0400 +++ b/rogue4/monsters.c Wed Apr 14 18:55:33 2021 -0400 @@ -75,7 +75,7 @@ tp->t_type = type; tp->t_disguise = type; tp->t_pos = *cp; - tp->t_oldch = mvinch(cp->y, cp->x); + tp->t_oldch = mvinch(cp->y, cp->x) & A_CHARTEXT; tp->t_room = roomin(cp); moat(cp->y, cp->x) = tp; mp = &monsters[tp->t_type-'A']; diff -r e06ebc407615 -r e52a8a7ad4c5 rogue4/options.c --- a/rogue4/options.c Sat Mar 20 22:36:52 2021 -0400 +++ b/rogue4/options.c Wed Apr 14 18:55:33 2021 -0400 @@ -15,6 +15,7 @@ #include #include #include +#include #include "rogue.h" #define EQSTR(a, b, c) (strncmp(a, b, c) == 0) diff -r e06ebc407615 -r e52a8a7ad4c5 rogue4/pack.c --- a/rogue4/pack.c Sat Mar 20 22:36:52 2021 -0400 +++ b/rogue4/pack.c Wed Apr 14 18:55:33 2021 -0400 @@ -102,6 +102,7 @@ * Check for and deal with scare monster scrolls */ if (obj->o_type == SCROLL && obj->o_which == S_SCARE) + { if (obj->o_flags & ISFOUND) { detach(lvl_obj, obj); @@ -112,6 +113,7 @@ } else obj->o_flags |= ISFOUND; + } inpack++; if (from_floor) @@ -256,7 +258,7 @@ void pick_up(char ch) { - register THING *obj, *mp; + register THING *obj; switch (ch) { diff -r e06ebc407615 -r e52a8a7ad4c5 rogue4/rip.c --- a/rogue4/rip.c Sat Mar 20 22:36:52 2021 -0400 +++ b/rogue4/rip.c Wed Apr 14 18:55:33 2021 -0400 @@ -99,10 +99,12 @@ } #ifdef WIZARD if (wizard) + { if (strcmp(prbuf, "names") == 0) prflags = 1; else if (strcmp(prbuf, "edit") == 0) prflags = 2; + } #endif for(i=0; i<10; i++) { @@ -164,7 +166,7 @@ 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) @@ -414,10 +416,12 @@ 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 * 100; else worth = 10; + } if (!(obj->o_flags & ISKNOW)) worth /= 2; obj->o_flags |= ISKNOW; diff -r e06ebc407615 -r e52a8a7ad4c5 rogue4/rogue.h --- a/rogue4/rogue.h Sat Mar 20 22:36:52 2021 -0400 +++ b/rogue4/rogue.h Wed Apr 14 18:55:33 2021 -0400 @@ -10,6 +10,10 @@ * See the file LICENSE.TXT for full copyright and licensing information. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + typedef struct { const char *st_name; const int st_value; @@ -50,7 +54,7 @@ /* * All the fun defines */ -#define shint char /* short integer (for very small #s) */ +#define shint signed char /* short integer (for very small #s) */ #define when break;case #define otherwise break;default #define until(expr) while(!(expr)) @@ -83,7 +87,7 @@ #define moat(y,x) (_monst[((x) << 5) + (y)]) #define unc(cp) (cp).y, (cp).x #ifdef WIZARD -#define debug if (wizard) msg +#define debug if (wizard) msg #endif /* @@ -532,6 +536,9 @@ void genocide(void); bool get_dir(void); THING *get_item(char *purpose, int type); +#ifdef WIZARD +int get_num(short *opt, WINDOW *win); +#endif int get_str(char *opt, WINDOW *win); void give_pack(THING *tp); bool hit_monster(int y, int x, THING *obj); @@ -542,7 +549,7 @@ void init_player(void); void init_stones(void); void init_things(void); -void init_weapon(THING *weap, char type); +void init_weapon(THING *weap, signed char type); char *inv_name(THING *obj, bool drop); bool inventory(THING *list, int type); void invis_on(void); @@ -633,9 +640,6 @@ void wield(void); void writelog(int amount, int flags, char monst); -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif #include "extern.h" #ifndef PATH_MAX diff -r e06ebc407615 -r e52a8a7ad4c5 rogue4/rooms.c --- a/rogue4/rooms.c Sat Mar 20 22:36:52 2021 -0400 +++ b/rogue4/rooms.c Wed Apr 14 18:55:33 2021 -0400 @@ -235,7 +235,7 @@ floor = ((rp->r_flags & ISDARK) && !on(player, ISBLIND)) ? ' ' : FLOOR; for (y = rp->r_pos.y + 1; y < rp->r_max.y + rp->r_pos.y - 1; y++) for (x = rp->r_pos.x + 1; x < rp->r_max.x + rp->r_pos.x - 1; x++) - switch (ch = mvinch(y, x)) + switch (ch = mvinch(y, x) & A_CHARTEXT) { case ' ': case TRAP: @@ -251,6 +251,7 @@ * standout bit */ if (isupper(toascii(ch))) + { if (on(player, SEEMONST)) { standout(); @@ -270,6 +271,7 @@ msg("couldn't find monster in leave_room at (%d,%d)", y, x); #endif } + } addch(floor); } diff -r e06ebc407615 -r e52a8a7ad4c5 rogue4/state.c --- a/rogue4/state.c Sat Mar 20 22:36:52 2021 -0400 +++ b/rogue4/state.c Wed Apr 14 18:55:33 2021 -0400 @@ -2078,7 +2078,9 @@ int rs_restore_file(FILE *inf) { +#ifndef WIZARD bool junk; +#endif THING *mitem; int endian = 0x01020304; big_endian = ( *((char *)&endian) == 0x01 ); diff -r e06ebc407615 -r e52a8a7ad4c5 rogue4/sticks.c --- a/rogue4/sticks.c Sat Mar 20 22:36:52 2021 -0400 +++ b/rogue4/sticks.c Wed Apr 14 18:55:33 2021 -0400 @@ -159,7 +159,8 @@ rnd_pos(&rooms[rm], &tp->t_pos); } until (winat(tp->t_pos.y, tp->t_pos.x) == FLOOR); tp->t_room = roomin(&tp->t_pos); - tp->t_oldch = mvinch(tp->t_pos.y, tp->t_pos.x); + tp->t_oldch = mvinch(tp->t_pos.y, tp->t_pos.x) & + A_CHARTEXT; if (see_monst(tp)) mvaddch(tp->t_pos.y, tp->t_pos.x, tp->t_disguise); else if (on(player, SEEMONST)) @@ -175,7 +176,8 @@ tp->t_pos.x = hero.x + delta.x; if (tp->t_pos.y != y || tp->t_pos.x != x) - tp->t_oldch = mvinch(tp->t_pos.y, tp->t_pos.x); + tp->t_oldch = mvinch(tp->t_pos.y, tp->t_pos.x) & + A_CHARTEXT; } moat(y, x) = NULL; moat(tp->t_pos.y, tp->t_pos.x) = tp; @@ -423,10 +425,12 @@ if (!save(VS_MAGIC)) { if ((pstats.s_hpt -= roll(6, 6)) <= 0) + { if (start == &hero) death('b'); else death(moat(start->y, start->x)->t_type); + } used = TRUE; if (terse) msg("the %s hits", name); diff -r e06ebc407615 -r e52a8a7ad4c5 rogue4/things.c --- a/rogue4/things.c Sat Mar 20 22:36:52 2021 -0400 +++ b/rogue4/things.c Wed Apr 14 18:55:33 2021 -0400 @@ -287,10 +287,12 @@ * the second one, then turn it into a identify scroll */ if (cur->o_which == S_GENOCIDE) + { if (got_genocide) cur->o_which = S_IDENT; else got_genocide = TRUE; + } when 2: no_food = 0; cur->o_type = FOOD; diff -r e06ebc407615 -r e52a8a7ad4c5 rogue4/weapons.c --- a/rogue4/weapons.c Sat Mar 20 22:36:52 2021 -0400 +++ b/rogue4/weapons.c Wed Apr 14 18:55:33 2021 -0400 @@ -162,7 +162,7 @@ * Set up the initial goodies for a weapon */ void -init_weapon(THING *weap, char type) +init_weapon(THING *weap, signed char type) { register struct init_weps *iwp; diff -r e06ebc407615 -r e52a8a7ad4c5 rogue5/mach_dep.c --- a/rogue5/mach_dep.c Sat Mar 20 22:36:52 2021 -0400 +++ b/rogue5/mach_dep.c Wed Apr 14 18:55:33 2021 -0400 @@ -377,12 +377,15 @@ } #endif +#if defined(SCOREFILE) && defined(LOCKFILE) +static FILE *lfd = NULL; +#endif + /* * lock_sc: * lock the score file. If it takes too long, ask the user if * they care to wait. Return TRUE if the lock is successful. */ -static FILE *lfd = NULL; int lock_sc(void) { diff -r e06ebc407615 -r e52a8a7ad4c5 rogue5/rip.c --- a/rogue5/rip.c Sat Mar 20 22:36:52 2021 -0400 +++ b/rogue5/rip.c Wed Apr 14 18:55:33 2021 -0400 @@ -108,10 +108,12 @@ #ifdef MASTER if (wizard) + { if (strcmp(prbuf, "names") == 0) prflags = 1; else if (strcmp(prbuf, "edit") == 0) prflags = 2; + } #endif rd_score(top_ten); /* diff -r e06ebc407615 -r e52a8a7ad4c5 rogue5/state.c --- a/rogue5/state.c Sat Mar 20 22:36:52 2021 -0400 +++ b/rogue5/state.c Wed Apr 14 18:55:33 2021 -0400 @@ -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 ) diff -r e06ebc407615 -r e52a8a7ad4c5 srogue/armor.c --- a/srogue/armor.c Sat Mar 20 22:36:52 2021 -0400 +++ b/srogue/armor.c Wed Apr 14 18:55:33 2021 -0400 @@ -75,12 +75,10 @@ initarmor(struct object *obj, int what) { struct init_armor *iwa; - struct magic_item *mi; obj->o_type = ARMOR; obj->o_which = what; iwa = &armors[what]; - mi = &a_magic[what]; obj->o_vol = iwa->a_vol; obj->o_ac = iwa->a_class; obj->o_weight = iwa->a_wght; diff -r e06ebc407615 -r e52a8a7ad4c5 srogue/chase.c --- a/srogue/chase.c Sat Mar 20 22:36:52 2021 -0400 +++ b/srogue/chase.c Wed Apr 14 18:55:33 2021 -0400 @@ -210,7 +210,7 @@ } if (pl_off(ISBLIND)) mvwaddch(cw,th->t_pos.y,th->t_pos.x,th->t_oldch); - sch = mvwinch(cw, ch_ret.y, ch_ret.x); + sch = mvwinch(cw, ch_ret.y, ch_ret.x) & A_CHARTEXT; if (rer != NULL && rf_on(rer,ISDARK) && sch == FLOOR && DISTANCE(ch_ret.y,ch_ret.x,th->t_pos.y,th->t_pos.x) < 3 && pl_off(ISBLIND)) @@ -452,7 +452,8 @@ { if (ep->x == sp->x || ep->y == sp->y) return TRUE; - if (step_ok(mvinch(ep->y,sp->x)) && step_ok(mvinch(sp->y,ep->x))) + if (step_ok(mvinch(ep->y,sp->x) & A_CHARTEXT) && + step_ok(mvinch(sp->y,ep->x) & A_CHARTEXT)) return TRUE; return FALSE; } diff -r e06ebc407615 -r e52a8a7ad4c5 srogue/command.c --- a/srogue/command.c Sat Mar 20 22:36:52 2021 -0400 +++ b/srogue/command.c Wed Apr 14 18:55:33 2021 -0400 @@ -638,14 +638,10 @@ void shell(void) { - reg int pid; - reg char *sh; - int ret_status; /* * Set the terminal back to original mode */ - sh = getenv("SHELL"); wclear(hw); wmove(hw, LINES-1, 0); draw(hw); diff -r e06ebc407615 -r e52a8a7ad4c5 srogue/disply.c --- a/srogue/disply.c Sat Mar 20 22:36:52 2021 -0400 +++ b/srogue/disply.c Wed Apr 14 18:55:33 2021 -0400 @@ -30,7 +30,7 @@ for (i = 0; i < LINES - 2; i++) { for (j = 0; j < COLS - 1; j++) { - ch = mvinch(i,j); + ch = mvinch(i,j) & A_CHARTEXT; if (isatrap(ch)) { struct trap *what; @@ -60,7 +60,7 @@ it->t_oldch = ch; } } - mch = mvwinch(cw, i, j); + mch = mvwinch(cw, i, j) & A_CHARTEXT; if (isalpha(mch)) ch = mch; mvwaddch(cw, i, j, ch); @@ -77,7 +77,7 @@ void dispmons(void) { - reg int ch, y, x; + reg int y, x; reg struct thing *it; reg struct linked_list *item; @@ -103,7 +103,7 @@ reg char ch; if (mvwinch(mw,y,x) == ' ') - ch = mvinch(y, x); /* non-monsters */ + ch = mvinch(y, x) & A_CHARTEXT; /* non-monsters */ else ch = winch(mw); /* monsters */ return ch; diff -r e06ebc407615 -r e52a8a7ad4c5 srogue/init.c --- a/srogue/init.c Sat Mar 20 22:36:52 2021 -0400 +++ b/srogue/init.c Wed Apr 14 18:55:33 2021 -0400 @@ -122,7 +122,6 @@ init_colors(void) { reg int i, j; - reg char *str; bool used[NCOLORS]; for (i = 0; i < NCOLORS; i++) @@ -185,7 +184,6 @@ init_stones(void) { reg int i, j; - reg char *str; bool used[NSTONES]; for (i = 0; i < NSTONES; i++) diff -r e06ebc407615 -r e52a8a7ad4c5 srogue/io.c --- a/srogue/io.c Sat Mar 20 22:36:52 2021 -0400 +++ b/srogue/io.c Wed Apr 14 18:55:33 2021 -0400 @@ -136,8 +136,6 @@ int readchar(void) { - char c; - fflush(stdout); return( md_readchar(cw) ); } diff -r e06ebc407615 -r e52a8a7ad4c5 srogue/misc.c --- a/srogue/misc.c Sat Mar 20 22:36:52 2021 -0400 +++ b/srogue/misc.c Wed Apr 14 18:55:33 2021 -0400 @@ -133,7 +133,7 @@ mvaddch(y, x, FLOOR); else { tp = THINGPTR(it); - if (isatrap(tp->t_oldch = mvinch(y, x))) { + if (isatrap(tp->t_oldch = mvinch(y, x) & A_CHARTEXT)) { struct trap *trp; if ((trp = trap_at(y,x)) == NULL) diff -r e06ebc407615 -r e52a8a7ad4c5 srogue/monsters.c --- a/srogue/monsters.c Sat Mar 20 22:36:52 2021 -0400 +++ b/srogue/monsters.c Wed Apr 14 18:55:33 2021 -0400 @@ -102,7 +102,7 @@ tp->t_indx = type; tp->t_pos = *cp; tp->t_room = roomin(cp); - tp->t_oldch = mvwinch(cw, cp->y, cp->x); + tp->t_oldch = mvwinch(cw, cp->y, cp->x) & A_CHARTEXT; tp->t_nomove = 0; tp->t_nocmd = 0; mvwaddch(mw, cp->y, cp->x, tp->t_type); @@ -261,7 +261,7 @@ * Hide invisible monsters */ if ((tp->t_flags & ISINVIS) && pl_off(CANSEE)) - ch = mvinch(y, x); + ch = mvinch(y, x) & A_CHARTEXT; /* * Let greedy ones guard gold */ @@ -284,7 +284,7 @@ reg struct linked_list *ip, *nip; reg struct thing *mp; struct monster *mm; - reg int i, ii, c; + reg int i, c; if (levcount == 0) { mpos = 0; diff -r e06ebc407615 -r e52a8a7ad4c5 srogue/move.c --- a/srogue/move.c Sat Mar 20 22:36:52 2021 -0400 +++ b/srogue/move.c Wed Apr 14 18:55:33 2021 -0400 @@ -203,7 +203,7 @@ mvwaddch(cw, nh.y, nh.x, PLAYER); hero = nh; player.t_room = rp; - player.t_oldch = mvinch(hero.y, hero.x); + player.t_oldch = mvinch(hero.y, hero.x) & A_CHARTEXT; } /* @@ -263,13 +263,13 @@ mit = THINGPTR(item); if (mit->t_oldch == ' ') if (!rf_on(rp,ISDARK)) - mit->t_oldch = mvinch(y, x); + mit->t_oldch = mvinch(y, x) & A_CHARTEXT; if (levtype == MAZELEV) - ch = mvinch(y, x); + ch = mvinch(y, x) & A_CHARTEXT; } } if (rf_on(rp,ISDARK)) { - rch = mvwinch(cw, y, x); + rch = mvwinch(cw, y, x) & A_CHARTEXT; if (isatrap(rch)) { ch = rch; /* if its a trap */ } @@ -320,7 +320,7 @@ if (ch == 's') ch = ' '; /* shadows show as a blank */ else - ch = mvinch(y, x); /* hide invisibles */ + ch = mvinch(y, x) & A_CHARTEXT; /* hide invisibles */ } } } @@ -336,7 +336,6 @@ { reg struct trap *trp; reg int ch, ishero; - struct linked_list *mon; char stuckee[35], seeit, sayso; if ((trp = trap_at(tc->y, tc->x)) == NULL) diff -r e06ebc407615 -r e52a8a7ad4c5 srogue/new_leve.c --- a/srogue/new_leve.c Sat Mar 20 22:36:52 2021 -0400 +++ b/srogue/new_leve.c Wed Apr 14 18:55:33 2021 -0400 @@ -26,7 +26,6 @@ void new_level(int ltype) { - register int i; register char ch; struct coord traploc; struct room *rp; @@ -136,7 +135,7 @@ } while(levtype==MAZELEV&&DISTANCE(hero.y,hero.x,stairs.y,stairs.x)<10); player.t_room = rp; - player.t_oldch = mvinch(hero.y, hero.x); + player.t_oldch = mvinch(hero.y, hero.x) & A_CHARTEXT; light(&hero); mvwaddch(cw,hero.y,hero.x,PLAYER); nochange = FALSE; diff -r e06ebc407615 -r e52a8a7ad4c5 srogue/passages.c --- a/srogue/passages.c Sat Mar 20 22:36:52 2021 -0400 +++ b/srogue/passages.c Wed Apr 14 18:55:33 2021 -0400 @@ -132,7 +132,7 @@ conn(int r1, int r2) { reg struct room *rpf, *rpt = NULL; - reg char rmt, direc; + reg signed char rmt, direc; reg int distance, turn_spot, turn_distance, rm; struct coord curr, turn_delta, spos, epos; diff -r e06ebc407615 -r e52a8a7ad4c5 srogue/rings.c --- a/srogue/rings.c Sat Mar 20 22:36:52 2021 -0400 +++ b/srogue/rings.c Wed Apr 14 18:55:33 2021 -0400 @@ -288,7 +288,7 @@ ring_eat(void) { reg struct object *lb; - reg int hand, i, howmuch; + reg int i, howmuch; bool addit; howmuch = 0; diff -r e06ebc407615 -r e52a8a7ad4c5 srogue/rip.c --- a/srogue/rip.c Sat Mar 20 22:36:52 2021 -0400 +++ b/srogue/rip.c Wed Apr 14 18:55:33 2021 -0400 @@ -288,9 +288,9 @@ for (scp = top_ten; scp <= &top_ten[9]; scp++) { if (scp->sc_score > 0) { printf("%d\t%d\t%s: %s\t\t--> %s on level %d", - scp - top_ten + 1, scp->sc_score, scp->sc_name, - ctime(&scp->sc_date), reason[scp->sc_flags], - scp->sc_level); + (int) (scp - top_ten + 1), scp->sc_score, + scp->sc_name, ctime(&scp->sc_date), + reason[scp->sc_flags], scp->sc_level); if (scp->sc_flags == KILLED) { killer = killname(scp->sc_monster); printf(" by a%s %s",vowelstr(killer), killer); diff -r e06ebc407615 -r e52a8a7ad4c5 srogue/rooms.c --- a/srogue/rooms.c Sat Mar 20 22:36:52 2021 -0400 +++ b/srogue/rooms.c Wed Apr 14 18:55:33 2021 -0400 @@ -31,9 +31,7 @@ bool treas = FALSE; reg int i; reg struct room *rp; - reg struct linked_list *item; - reg struct thing *tp; - struct coord top, bsze, mp; + struct coord top, bsze; /* * bsze is the maximum room size diff -r e06ebc407615 -r e52a8a7ad4c5 srogue/save.c --- a/srogue/save.c Sat Mar 20 22:36:52 2021 -0400 +++ b/srogue/save.c Wed Apr 14 18:55:33 2021 -0400 @@ -55,7 +55,6 @@ bool save_game(void) { - reg FILE *savef; reg int c; char buf[LINLEN]; @@ -191,8 +190,6 @@ bool restore(char *file, char **envp) { - register int pid; - int ret_status; #ifndef _AIX extern char **environ; #endif @@ -305,4 +302,5 @@ restscr(cw); md_srandom(md_random_seed()); playit(); + return FALSE; } diff -r e06ebc407615 -r e52a8a7ad4c5 srogue/scrolls.c --- a/srogue/scrolls.c Sat Mar 20 22:36:52 2021 -0400 +++ b/srogue/scrolls.c Wed Apr 14 18:55:33 2021 -0400 @@ -32,7 +32,6 @@ reg int i, j, wh; reg char ch, nch; struct room *rp; - struct linked_list *titem; char buf[LINLEN]; bool bless, curse; @@ -161,7 +160,7 @@ overwrite(stdscr, hw); for (i = 1; i < LINES - 2; i++) { for (j = 0; j < COLS; j++) { - switch (nch = ch = mvwinch(hw, i, j)) { + switch (nch = ch = mvwinch(hw, i, j) & A_CHARTEXT) { case SECRETDOOR: nch = DOOR; mvaddch(i, j, nch); diff -r e06ebc407615 -r e52a8a7ad4c5 srogue/state.c --- a/srogue/state.c Sat Mar 20 22:36:52 2021 -0400 +++ b/srogue/state.c Wed Apr 14 18:55:33 2021 -0400 @@ -832,7 +832,6 @@ int rs_read_strings(FILE *inf, char **s, int count, int max) { - int len = 0; int n = 0; int value = 0; @@ -2243,7 +2242,9 @@ int rs_restore_file(FILE *inf) { +#ifndef WIZARD bool junk; +#endif int endian = 0x01020304; big_endian = ( *((char *)&endian) == 0x01 ); diff -r e06ebc407615 -r e52a8a7ad4c5 srogue/sticks.c --- a/srogue/sticks.c Sat Mar 20 22:36:52 2021 -0400 +++ b/srogue/sticks.c Wed Apr 14 18:55:33 2021 -0400 @@ -219,7 +219,7 @@ y += delta.y; x += delta.x; } while (step_ok(winat(y, x))); - if (isalpha(monster = mvwinch(mw, y, x))) { + if (isalpha(monster = mvwinch(mw, y, x) & A_CHARTEXT)) { int omonst; if (wh != WS_MINVIS) @@ -271,7 +271,7 @@ tp->t_flags |= ISRUN; mvwaddch(mw, y, x, ' '); mvwaddch(mw, tp->t_pos.y, tp->t_pos.x, monster); - tp->t_oldch = mvwinch(cw,tp->t_pos.y,tp->t_pos.x); + tp->t_oldch = mvwinch(cw,tp->t_pos.y,tp->t_pos.x) & A_CHARTEXT; } } } diff -r e06ebc407615 -r e52a8a7ad4c5 srogue/things.c --- a/srogue/things.c Sat Mar 20 22:36:52 2021 -0400 +++ b/srogue/things.c Wed Apr 14 18:55:33 2021 -0400 @@ -223,7 +223,7 @@ reg struct object *op; if (item == NULL) { - ch = mvinch(hero.y, hero.x); + ch = mvinch(hero.y, hero.x) & A_CHARTEXT; if (ch != FLOOR && ch != PASSAGE && ch != POOL) { msg("There is something there already."); after = FALSE; diff -r e06ebc407615 -r e52a8a7ad4c5 srogue/trader.c --- a/srogue/trader.c Sat Mar 20 22:36:52 2021 -0400 +++ b/srogue/trader.c Wed Apr 14 18:55:33 2021 -0400 @@ -299,7 +299,6 @@ void do_maze(void) { - struct coord tp; reg int i, least; reg struct room *rp; bool treas; @@ -485,7 +484,7 @@ void crankout(void) { - reg int x, y, i; + reg int x, y; for (y = 0; y < LINES - 3; y++) { move(y + 1, 0); diff -r e06ebc407615 -r e52a8a7ad4c5 srogue/weapons.c --- a/srogue/weapons.c Sat Mar 20 22:36:52 2021 -0400 +++ b/srogue/weapons.c Wed Apr 14 18:55:33 2021 -0400 @@ -141,10 +141,12 @@ } if (pr) - if (obj->o_type == WEAPON) /* BUGFIX: Identification trick */ - msg("Your %s vanishes as it hits the ground.", w_magic[obj->o_which].mi_name); - else - msg("%s vanishes as it hits the ground.", inv_name(obj,TRUE)); + { + if (obj->o_type == WEAPON) /* BUGFIX: Identification trick */ + msg("Your %s vanishes as it hits the ground.", w_magic[obj->o_which].mi_name); + else + msg("%s vanishes as it hits the ground.", inv_name(obj,TRUE)); + } discard(item); } diff -r e06ebc407615 -r e52a8a7ad4c5 srogue/wizard.c --- a/srogue/wizard.c Sat Mar 20 22:36:52 2021 -0400 +++ b/srogue/wizard.c Wed Apr 14 18:55:33 2021 -0400 @@ -319,7 +319,7 @@ th->t_pos = spot; rm = rp - &rooms[0]; th->t_room = rp; - th->t_oldch = mvwinch(cw, th->t_pos.y, th->t_pos.x); + th->t_oldch = mvwinch(cw, th->t_pos.y, th->t_pos.x) & A_CHARTEXT; if (ishero) light(&oldspot); th->t_nomove = 0; diff -r e06ebc407615 -r e52a8a7ad4c5 urogue/command.c --- a/urogue/command.c Sat Mar 20 22:36:52 2021 -0400 +++ b/urogue/command.c Wed Apr 14 18:55:33 2021 -0400 @@ -33,7 +33,9 @@ static int fight_to_death; /* Flags if we are fighting to death */ static coord dir; /* Last direction specified */ +#ifdef WIZARD object *obj; +#endif char ch; int ntimes = 1; /* Number of player moves */ coord nullcoord; @@ -579,10 +581,12 @@ * If he ran into something to take, let him pick it up. */ if (take != 0) + { if (!moving) pick_up(take); else show_floor(); + } if (!running) door_stop = FALSE; } /* end while */ @@ -676,10 +680,11 @@ } } } - } + } - /* Time to enforce weapon and armor restrictions */ - if (rnd(9999) == 0) + /* Time to enforce weapon and armor restrictions */ + if (rnd(9999) == 0) + { if (((cur_weapon == NULL) || (wield_ok(&player, cur_weapon, NOMESSAGE))) && ((cur_armor == NULL) || @@ -774,6 +779,7 @@ death(death_cause); } } + } if (rnd(500000) == 0) { @@ -1038,6 +1044,7 @@ while (strp->h_ch) { if (strp->h_desc == 0) + { if (!wizard) break; else @@ -1045,6 +1052,7 @@ strp++; continue; } + } if (strp->h_ch == helpch) { @@ -1071,6 +1079,7 @@ while (strp->h_ch) { if (strp->h_desc == 0) + { if (!wizard) break; else @@ -1078,6 +1087,7 @@ strp++; continue; } + } mvwaddstr(hw, cnt % 23, cnt > 22 ? 40 : 0, unctrl(strp->h_ch)); waddstr(hw, strp->h_desc); diff -r e06ebc407615 -r e52a8a7ad4c5 urogue/fight.c --- a/urogue/fight.c Sat Mar 20 22:36:52 2021 -0400 +++ b/urogue/fight.c Wed Apr 14 18:55:33 2021 -0400 @@ -245,9 +245,8 @@ if (is_wearing(R_HEALTH) || player.t_ctype == C_PALADIN || - (player.t_ctype == C_NINJA && pstats.s_lvl - > 6) || - thrown && rnd(50) > 0 || + (player.t_ctype == C_NINJA && pstats.s_lvl > 6) || + (thrown && rnd(50) > 0) || rnd(20) > 0) { msg("The dust makes it hard to breath."); @@ -331,7 +330,9 @@ } if (itm == NULL) + { debug("Can't find crystalline armor being worn."); + } else { msg("Your armor shatters from the shriek."); @@ -554,7 +555,9 @@ } if (item == NULL) + { debug("Can't find crystalline armor being worn."); + } else { msg("Your armor is shattered by the blow."); @@ -1034,20 +1037,20 @@ msg("You feel nimble fingers reach into you pack."); } - if ((obj != cur_armor && - obj != cur_weapon && - obj != cur_ring[LEFT_1] && - obj != cur_ring[LEFT_2] && - obj != cur_ring[LEFT_3] && - obj != cur_ring[LEFT_4] && - obj != cur_ring[LEFT_5] && - obj != cur_ring[RIGHT_1] && - obj != cur_ring[RIGHT_2] && - obj != cur_ring[RIGHT_3] && - obj != cur_ring[RIGHT_4] && - obj != cur_ring[RIGHT_5] && - !(obj->o_flags & ISPROT) && - is_magic(obj) + if (((obj != cur_armor && + obj != cur_weapon && + obj != cur_ring[LEFT_1] && + obj != cur_ring[LEFT_2] && + obj != cur_ring[LEFT_3] && + obj != cur_ring[LEFT_4] && + obj != cur_ring[LEFT_5] && + obj != cur_ring[RIGHT_1] && + obj != cur_ring[RIGHT_2] && + obj != cur_ring[RIGHT_3] && + obj != cur_ring[RIGHT_4] && + obj != cur_ring[RIGHT_5] && + !(obj->o_flags & ISPROT) && + is_magic(obj)) || level > 45) && get_worth(obj) > worth) { @@ -2099,9 +2102,9 @@ /* Try to summon if less than 1/3 max hit points */ if (on(*mons, CANSUMMON) && - (force == FORCE || - (mons->t_stats.s_hpt < mons->maxstats.s_hpt / 3) && - (rnd(40 * 10) < (mons->t_stats.s_lvl * mons->t_stats.s_intel)))) + (force == FORCE || + ((mons->t_stats.s_hpt < mons->maxstats.s_hpt / 3) && + (rnd(40 * 10) < (mons->t_stats.s_lvl * mons->t_stats.s_intel))))) { turn_off(*mons, CANSUMMON); msg("The %s summons its attendants!", mname); diff -r e06ebc407615 -r e52a8a7ad4c5 urogue/io.c --- a/urogue/io.c Sat Mar 20 22:36:52 2021 -0400 +++ b/urogue/io.c Wed Apr 14 18:55:33 2021 -0400 @@ -107,7 +107,8 @@ { strcpy(msgbuf[msg_index], mbuf); - msg_index = ++msg_index % 10; + msg_index++; + msg_index %= 10; if (mpos) { diff -r e06ebc407615 -r e52a8a7ad4c5 urogue/mdport.c --- a/urogue/mdport.c Sat Mar 20 22:36:52 2021 -0400 +++ b/urogue/mdport.c Wed Apr 14 18:55:33 2021 -0400 @@ -109,7 +109,9 @@ # define SE exit_standout_mode #endif +#ifdef _WIN32 static int md_standout_mode = 0; +#endif void md_raw_standout() @@ -281,7 +283,9 @@ #endif if ( (h == NULL) || (*h == '\0') ) + { if ( (h = getenv("HOME")) == NULL ) + { if ( (h = getenv("HOMEDRIVE")) == NULL) h = ""; else @@ -292,6 +296,8 @@ if ( (h = getenv("HOMEPATH")) == NULL) h = ""; } + } + } len = strlen(homedir); @@ -372,7 +378,7 @@ */ setuid(getuid()); setgid(getgid()); - execl(sh == NULL ? "/bin/sh" : sh, "shell", "-i", 0); + execl(sh == NULL ? "/bin/sh" : sh, "shell", "-i", (char *) NULL); perror("No shelly"); _exit(-1); } @@ -601,6 +607,7 @@ avg[0] = avg[1] = avg[2] = 0.0; return -1; } + return 3; } long diff -r e06ebc407615 -r e52a8a7ad4c5 urogue/memory.c --- a/urogue/memory.c Sat Mar 20 22:36:52 2021 -0400 +++ b/urogue/memory.c Wed Apr 14 18:55:33 2021 -0400 @@ -36,8 +36,10 @@ #define FENCE_SIZE (sizeof(size_t) * 1024) static int memdebug_level = 0; +#ifdef MEM_DEBUG static DICTIONARY *allocations = NULL; static FILE *trace_file = NULL; +#endif /* set the debug level */ void mem_debug(const int level) diff -r e06ebc407615 -r e52a8a7ad4c5 urogue/misc.c --- a/urogue/misc.c Sat Mar 20 22:36:52 2021 -0400 +++ b/urogue/misc.c Wed Apr 14 18:55:33 2021 -0400 @@ -207,7 +207,7 @@ if (off(player, ISBLIND)) { - if (y == hero.y && x == hero.x || (inpass && (ch == '-' || + if ((y == hero.y && x == hero.x) || (inpass && (ch == '-' || ch == '|'))) continue; diff -r e06ebc407615 -r e52a8a7ad4c5 urogue/monsters.c --- a/urogue/monsters.c Sat Mar 20 22:36:52 2021 -0400 +++ b/urogue/monsters.c Wed Apr 14 18:55:33 2021 -0400 @@ -892,6 +892,7 @@ } } else if (off(player, ISBLIND)) + { if (save(VS_WAND) || is_wearing(R_TRUESEE) || is_wearing(R_SEEINVIS)) msg("Your eyes film over for a moment."); else @@ -901,6 +902,7 @@ light_fuse(FUSE_SIGHT, 0, rnd(30) + 20, AFTER); look(FALSE); } + } } if (on(*tp, LOOKSTONE)) /* Stoning */ diff -r e06ebc407615 -r e52a8a7ad4c5 urogue/move.c --- a/urogue/move.c Sat Mar 20 22:36:52 2021 -0400 +++ b/urogue/move.c Wed Apr 14 18:55:33 2021 -0400 @@ -222,7 +222,7 @@ if ((rnd(100) < 80 && on(player, ISHUH)) || (is_wearing(R_DELUSION) && rnd(100) < 25) || - on(player, STUMBLER) && rnd(40) == 0) + (on(player, STUMBLER) && rnd(40) == 0)) player.t_nxtpos = rndmove(&player); else { @@ -768,10 +768,10 @@ if (((is_wearing(R_LEVITATION) || on(player, CANFLY)) && (ch != FIRETRAP || (ch == FIRETRAP && !(tp->tr_flags & ISFOUND)))) - || (moving && (tp->tr_flags & ISFOUND) && rnd(100) < + || ((moving && (tp->tr_flags & ISFOUND) && rnd(100) < thief_bonus + 2 * pstats.s_dext + 5 * pstats.s_lvl) && (ch == BEARTRAP || ch == MAZETRAP || ch == TRAPDOOR - || ch == ARROWTRAP || ch == DARTTRAP)) + || ch == ARROWTRAP || ch == DARTTRAP))) { static char trname[1024]; msg(tr_name(ch,trname)); @@ -1070,6 +1070,7 @@ th->t_stats.s_hpt -= roll(1, 4); if (orig_hp == th->t_stats.s_hpt) + { if (can_see) msg("The dart has not effect!"); else if (th->t_stats.s_hpt < 0) @@ -1082,6 +1083,7 @@ killed(NULL, mitem, NOMESSAGE, NOPOINTS); } + } } } else diff -r e06ebc407615 -r e52a8a7ad4c5 urogue/newlvl.c --- a/urogue/newlvl.c Sat Mar 20 22:36:52 2021 -0400 +++ b/urogue/newlvl.c Wed Apr 14 18:55:33 2021 -0400 @@ -264,7 +264,7 @@ turn_off(player, BLESSMAP); } - if (player.t_ctype == C_THIEF || on(player, BLESSGOLD) && rnd(5) == 0) + if (player.t_ctype == C_THIEF || (on(player, BLESSGOLD) && rnd(5) == 0)) { read_scroll(&player, S_GFIND, ISNORMAL); @@ -272,7 +272,8 @@ turn_off(player, BLESSGOLD); } - if (player.t_ctype == C_RANGER || on(player, BLESSFOOD) && rnd(5) == 0) + if (player.t_ctype == C_RANGER || + (on(player, BLESSFOOD) && rnd(5) == 0)) { read_scroll(&player, S_FOODDET, ISNORMAL); @@ -281,7 +282,7 @@ } if (player.t_ctype == C_MAGICIAN || player.t_ctype == C_ILLUSION || - on(player, BLESSMAGIC) && rnd(5) == 0) + (on(player, BLESSMAGIC) && rnd(5) == 0)) { quaff(&player, P_TREASDET, ISNORMAL); @@ -289,7 +290,7 @@ turn_off(player, BLESSMAGIC); } - if (player.t_ctype == C_DRUID || on(player, BLESSMONS) && rnd(5) == 0) + if (player.t_ctype == C_DRUID || (on(player, BLESSMONS) && rnd(5) == 0)) { quaff(&player, P_MONSTDET, ISNORMAL); @@ -305,7 +306,7 @@ aggravate(); if (is_wearing(R_ADORNMENT) || - cur_armor != NULL && cur_armor->o_which == MITHRIL) + (cur_armor != NULL && cur_armor->o_which == MITHRIL)) { int greed = FALSE; diff -r e06ebc407615 -r e52a8a7ad4c5 urogue/options.c --- a/urogue/options.c Sat Mar 20 22:36:52 2021 -0400 +++ b/urogue/options.c Wed Apr 14 18:55:33 2021 -0400 @@ -78,6 +78,7 @@ retval = (*op->o_getfunc)(&op->o_opt, hw); if (retval) + { if (retval == QUIT) break; else if (op > optlist) /* MINUS */ @@ -91,6 +92,7 @@