diff options
author | dholland <dholland@NetBSD.org> | 2008-01-28 05:38:53 +0000 |
---|---|---|
committer | dholland <dholland@NetBSD.org> | 2008-01-28 05:38:53 +0000 |
commit | e30950ccc7c7c31c69f1d31c16b0212bbf168ceb (patch) | |
tree | 2db2120a69bedac57d95d284e878f9975b6a17ed /larn/moreobj.c | |
parent | 9005237a04850abb22afe099ef07649b4115ed3f (diff) | |
download | bsdgames-darwin-e30950ccc7c7c31c69f1d31c16b0212bbf168ceb.tar.gz bsdgames-darwin-e30950ccc7c7c31c69f1d31c16b0212bbf168ceb.tar.zst bsdgames-darwin-e30950ccc7c7c31c69f1d31c16b0212bbf168ceb.zip |
Larn now builds with WARNS=4.
Diffstat (limited to 'larn/moreobj.c')
-rw-r--r-- | larn/moreobj.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/larn/moreobj.c b/larn/moreobj.c index b9ace546..70853acb 100644 --- a/larn/moreobj.c +++ b/larn/moreobj.c @@ -1,4 +1,4 @@ -/* $NetBSD: moreobj.c,v 1.7 2008/01/28 03:39:31 dholland Exp $ */ +/* $NetBSD: moreobj.c,v 1.8 2008/01/28 05:38:54 dholland Exp $ */ /* * moreobj.c Larn is copyrighted 1986 by Noah Morgan. @@ -9,7 +9,7 @@ */ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: moreobj.c,v 1.7 2008/01/28 03:39:31 dholland Exp $"); +__RCSID("$NetBSD: moreobj.c,v 1.8 2008/01/28 05:38:54 dholland Exp $"); #endif /* not lint */ #include <stdlib.h> #include <unistd.h> @@ -29,7 +29,7 @@ static void fch(int, long *); void oaltar() { - unsigned long k; + long amt; lprcat("\nDo you (p) pray (d) desecrate"); iopts(); @@ -66,13 +66,13 @@ oaltar() cursor(1, 23); cltoeoln(); lprcat("how much do you donate? "); - k = readnum((long) c[GOLD]); - if (c[GOLD] < k) { + amt = readnum((long) c[GOLD]); + if (amt < 0 || c[GOLD] < amt) { lprcat("\nYou don't have that much!"); return; } - c[GOLD] -= k; - if (k < c[GOLD] / 10 || k < rnd(50)) { + c[GOLD] -= amt; + if (amt < c[GOLD] / 10 || amt < rnd(50)) { createmonster(makemonst(level + 1)); c[AGGRAVATE] += 200; } else if (rnd(101) > 50) { |