summaryrefslogtreecommitdiffstats
path: root/larn/moreobj.c
diff options
context:
space:
mode:
authordholland <dholland@NetBSD.org>2008-01-28 05:38:53 +0000
committerdholland <dholland@NetBSD.org>2008-01-28 05:38:53 +0000
commite30950ccc7c7c31c69f1d31c16b0212bbf168ceb (patch)
tree2db2120a69bedac57d95d284e878f9975b6a17ed /larn/moreobj.c
parent9005237a04850abb22afe099ef07649b4115ed3f (diff)
downloadbsdgames-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.c14
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) {