summaryrefslogtreecommitdiffstats
path: root/battlestar
diff options
context:
space:
mode:
authorjsm <jsm@NetBSD.org>2000-09-25 00:28:54 +0000
committerjsm <jsm@NetBSD.org>2000-09-25 00:28:54 +0000
commit23b3d8457f74713738af6aed84ec915a8df2d58a (patch)
tree3112ea9bb4d3616b0930aec9c6d1a14f050c491a /battlestar
parent7bb2eac314ceddc83e22713cde57c69b6230f916 (diff)
downloadbsdgames-darwin-23b3d8457f74713738af6aed84ec915a8df2d58a.tar.gz
bsdgames-darwin-23b3d8457f74713738af6aed84ec915a8df2d58a.tar.zst
bsdgames-darwin-23b3d8457f74713738af6aed84ec915a8df2d58a.zip
Fix logic error in use of n and wordnumber in murder() when using
laser. From OpenBSD.
Diffstat (limited to 'battlestar')
-rw-r--r--battlestar/com2.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/battlestar/com2.c b/battlestar/com2.c
index fb70c0a1..5aa0c0dd 100644
--- a/battlestar/com2.c
+++ b/battlestar/com2.c
@@ -1,4 +1,4 @@
-/* $NetBSD: com2.c,v 1.18 2000/09/24 14:20:23 jsm Exp $ */
+/* $NetBSD: com2.c,v 1.19 2000/09/25 00:28:54 jsm Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)com2.c 8.2 (Berkeley) 4/28/95";
#else
-__RCSID("$NetBSD: com2.c,v 1.18 2000/09/24 14:20:23 jsm Exp $");
+__RCSID("$NetBSD: com2.c,v 1.19 2000/09/25 00:28:54 jsm Exp $");
#endif
#endif /* not lint */
@@ -182,25 +182,25 @@ murder()
if (n == NUMOFOBJECTS) {
if (testbit(inven, LASER)) {
printf("Your laser should do the trick.\n");
- n = wordnumber + 1;
- switch(wordvalue[n]) {
+ wordnumber++;
+ switch(wordvalue[wordnumber]) {
case NORMGOD:
case TIMER:
case NATIVE:
case MAN:
- wordvalue[wordnumber] = SHOOT;
+ wordvalue[--wordnumber] = SHOOT;
cypher();
break;
case -1:
puts("Kill what?");
break;
default:
- if (wordtype[n] != OBJECT ||
+ if (wordtype[wordnumber] != OBJECT ||
wordvalue[wordnumber] == EVERYTHING)
puts("You can't kill that!");
else
printf("You can't kill the %s!\n",
- objsht[wordvalue[n]]);
+ objsht[wordvalue[wordnumber]]);
break;
}
} else