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:
parent
6f21b5b88a
commit
6c3cd116ff
122 changed files with 374 additions and 280 deletions
|
|
@ -65,7 +65,7 @@ can_blink(struct thing *tp)
|
|||
|
||||
/* 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
|
||||
|
|
|
|||
|
|
@ -1032,12 +1032,9 @@ u_level(void)
|
|||
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 @@ nameitem(struct linked_list *item, bool mark)
|
|||
}
|
||||
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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -515,9 +515,11 @@ roll_em(struct thing *att_er, struct thing *def_er, struct object *weap,
|
|||
}
|
||||
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());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
#include "curses.h"
|
||||
#include <ctype.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "rogue.h"
|
||||
#include "mach_dep.h"
|
||||
|
|
@ -293,12 +294,15 @@ init_names(void)
|
|||
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 */
|
||||
|
|
|
|||
|
|
@ -109,7 +109,9 @@ md_init(void)
|
|||
# define SE exit_standout_mode
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
static int md_standout_mode = 0;
|
||||
#endif
|
||||
|
||||
void
|
||||
md_raw_standout(void)
|
||||
|
|
@ -297,7 +299,9 @@ md_gethomedir(void)
|
|||
#endif
|
||||
|
||||
if ( (h == NULL) || (*h == '\0') )
|
||||
{
|
||||
if ( (h = getenv("HOME")) == NULL )
|
||||
{
|
||||
if ( (h = getenv("HOMEDRIVE")) == NULL)
|
||||
h = "";
|
||||
else
|
||||
|
|
@ -308,6 +312,8 @@ md_gethomedir(void)
|
|||
if ( (h = getenv("HOMEPATH")) == NULL)
|
||||
h = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
len = strlen(homedir);
|
||||
|
|
@ -378,7 +384,7 @@ md_shellescape(void)
|
|||
*/
|
||||
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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -843,9 +843,8 @@ use_mm(int which)
|
|||
{
|
||||
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 @@ use_mm(int which)
|
|||
is_mm = TRUE;
|
||||
|
||||
obj = OBJPTR(item);
|
||||
cursed = (obj->o_flags & ISCURSED) != 0;
|
||||
blessed = (obj->o_flags & ISBLESSED) != 0;
|
||||
which = obj->o_which;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1752,7 +1752,7 @@ show(int y, int x)
|
|||
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);
|
||||
|
||||
|
|
|
|||
|
|
@ -240,6 +240,7 @@ get_str(char *opt, WINDOW *win)
|
|||
continue;
|
||||
}
|
||||
else if (sp == buf)
|
||||
{
|
||||
if (c == '-' && win == hw) /* To move back a line in hw */
|
||||
break;
|
||||
else if (c == '~')
|
||||
|
|
@ -249,6 +250,7 @@ get_str(char *opt, WINDOW *win)
|
|||
sp += strlen(home);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
*sp++ = c;
|
||||
waddstr(win, unctrl(c));
|
||||
}
|
||||
|
|
@ -299,6 +301,7 @@ option(void)
|
|||
{
|
||||
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 @@ option(void)
|
|||
wmove(hw, 0, 0);
|
||||
op--;
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Switch back to original screen
|
||||
|
|
|
|||
|
|
@ -143,7 +143,7 @@ void
|
|||
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];
|
||||
|
|
|
|||
|
|
@ -500,7 +500,7 @@ steal(void)
|
|||
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? */
|
||||
|
|
|
|||
|
|
@ -580,7 +580,7 @@ score(unsigned long amount, int flags, short monst)
|
|||
/* 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]",
|
||||
|
|
|
|||
|
|
@ -32,9 +32,6 @@ genocide(void)
|
|||
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");
|
||||
|
|
|
|||
|
|
@ -1366,7 +1366,7 @@ rs_write_sticks(FILE *savef)
|
|||
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 @@ rs_write_room(FILE *savef, struct room *r)
|
|||
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)
|
||||
|
|
|
|||
|
|
@ -91,7 +91,8 @@ do_zap(struct thing *zapper, struct object *obj, coord *direction, int which,
|
|||
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;
|
||||
|
|
|
|||
|
|
@ -583,7 +583,7 @@ get_dir(coord *direction)
|
|||
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 @@ look(bool wakeup, bool runend)
|
|||
*/
|
||||
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 @@ secretdoor(int y, int 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');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,7 +38,8 @@ create_obj(bool prompt, int which_item, int which_type)
|
|||
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 @@ create_obj(bool prompt, int which_item, int which_type)
|
|||
}
|
||||
if(msz == 1) { /* if only one type of item */
|
||||
ch = 'a';
|
||||
newtype = 0;
|
||||
}
|
||||
else if (prompt) {
|
||||
register struct magic_item *wmi;
|
||||
|
|
|
|||
|
|
@ -601,7 +601,7 @@ xcrypt(key, setting)
|
|||
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 @@ xcrypt(key, setting)
|
|||
/*
|
||||
* 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 @@ xcrypt(key, setting)
|
|||
*key)
|
||||
*q++ ^= *key++ << 1;
|
||||
|
||||
if (des_setkey((unsigned char *) keybuf))
|
||||
if (des_setkey((char *) keybuf))
|
||||
return(NULL);
|
||||
}
|
||||
strncpy((char *)output, setting, 9);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue