summaryrefslogtreecommitdiffstats
path: root/games/larn
diff options
context:
space:
mode:
authorbillf <billf@FreeBSD.org>1999-09-07 06:00:03 +0000
committerbillf <billf@FreeBSD.org>1999-09-07 06:00:03 +0000
commit3e1d9f25c8a992fb915d18ffaccb3a266e8ad0a4 (patch)
treea392a79dd376bd7e8273e85fac9e7af604437b66 /games/larn
parent33adb981d4021526b69c31fe25c2fc524378289f (diff)
downloadFreeBSD-src-3e1d9f25c8a992fb915d18ffaccb3a266e8ad0a4.zip
FreeBSD-src-3e1d9f25c8a992fb915d18ffaccb3a266e8ad0a4.tar.gz
Avoid ambigious if() if() else().
Diffstat (limited to 'games/larn')
-rw-r--r--games/larn/main.c6
-rw-r--r--games/larn/monster.c6
2 files changed, 10 insertions, 2 deletions
diff --git a/games/larn/main.c b/games/larn/main.c
index 49d3a2d..c42723e 100644
--- a/games/larn/main.c
+++ b/games/larn/main.c
@@ -50,7 +50,7 @@ main(argc,argv)
#ifndef VT100
init_term(); /* setup the terminal (find out what type) for termcap */
#endif VT100
- if (((ptr = getlogin()) == 0) || (*ptr==0)) /* try to get login name */
+ if (((ptr = getlogin()) == 0) || (*ptr==0)) { /* try to get login name */
if (pwe=getpwuid(getuid())) /* can we get it from /etc/passwd? */
ptr = pwe->pw_name;
else
@@ -60,6 +60,7 @@ main(argc,argv)
noone: write(2, "Can't find your logname. Who Are You?\n",39);
exit(1);
}
+ }
if (ptr==0) goto noone;
if (strlen(ptr)==0) goto noone;
/*
@@ -788,7 +789,7 @@ char *p;
while (1)
{
if ((i = whatitem("eat"))=='\33') return;
- if (i != '.')
+ if (i != '.') {
if (i=='*') showeat(); else
{
if (iven[i-'a']==OCOOKIE)
@@ -808,6 +809,7 @@ while (1)
if (iven[i-'a']==0) { ydhi(i); return; }
lprcat("\nYou can't eat that!"); return;
}
+ }
}
}
diff --git a/games/larn/monster.c b/games/larn/monster.c
index 649f925..041c976 100644
--- a/games/larn/monster.c
+++ b/games/larn/monster.c
@@ -713,6 +713,7 @@ omnidirect(spnum,dam,str)
for (y=playery-1; y<playery+2; y++)
{
if (m=mitem[x][y])
+ {
if (nospell(spnum,m) == 0)
{
ifblind(x,y);
@@ -720,6 +721,7 @@ omnidirect(spnum,dam,str)
hitm(x,y,dam); nap(800);
}
else { lasthx=x; lasthy=y; }
+ }
}
}
@@ -1085,7 +1087,9 @@ spattack(x,xx,yy)
case 1: /* rust your armor, j=1 when rusting has occurred */
m = k = c[WEAR];
if ((i=c[SHIELD]) != -1)
+ {
if (--ivenarg[i] < -1) ivenarg[i]= -1; else j=1;
+ }
if ((j==0) && (k != -1))
{
m = iven[k];
@@ -1226,6 +1230,7 @@ annihilate()
for (k=0, i=playerx-1; i<=playerx+1; i++)
for (j=playery-1; j<=playery+1; j++)
if (!vxy(&i,&j)) /* if not out of bounds */
+ {
if (*(p= &mitem[i][j])) /* if a monster there */
if (*p<DEMONLORD+2)
{
@@ -1236,6 +1241,7 @@ annihilate()
lprintf("\nThe %s barely escapes being annihilated!",monster[*p].name);
hitp[i][j] = (hitp[i][j]>>1) + 1; /* lose half hit points*/
}
+ }
if (k>0)
{
lprcat("\nYou hear loud screams of agony!"); raiseexperience((long)k);
OpenPOWER on IntegriCloud