]> git.cameronkatri.com Git - bsdgames-darwin.git/blobdiff - rogue/throw.c
constify, per PR 6148
[bsdgames-darwin.git] / rogue / throw.c
index ccb688d676f6c92dd91178094eab1ec282870495..31578f40b500025c6b87b86be45f01df095c0074 100644 (file)
@@ -1,6 +1,8 @@
+/*     $NetBSD: throw.c,v 1.5 1998/11/10 13:01:32 hubertf Exp $        */
+
 /*
- * Copyright (c) 1988 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1988, 1993
+ *     The Regents of the University of California.  All rights reserved.
  *
  * This code is derived from software contributed to Berkeley by
  * Timothy C. Stoehr.
  * SUCH DAMAGE.
  */
 
+#include <sys/cdefs.h>
 #ifndef lint
-static char sccsid[] = "@(#)throw.c    5.3 (Berkeley) 6/1/90";
+#if 0
+static char sccsid[] = "@(#)throw.c    8.1 (Berkeley) 5/31/93";
+#else
+__RCSID("$NetBSD: throw.c,v 1.5 1998/11/10 13:01:32 hubertf Exp $");
+#endif
 #endif /* not lint */
 
 /*
@@ -52,10 +59,7 @@ static char sccsid[] = "@(#)throw.c  5.3 (Berkeley) 6/1/90";
 
 #include "rogue.h"
 
-extern short cur_room;
-extern char *curse_message;
-extern char hit_message[];
-
+void
 throw()
 {
        short wch, d;
@@ -119,8 +123,9 @@ throw()
        vanish(weapon, 1, &rogue.pack);
 }
 
+boolean
 throw_at_monster(monster, weapon)
-object *monster, *weapon;
+       object *monster, *weapon;
 {
        short damage, hit_chance;
        short t;
@@ -156,9 +161,9 @@ object *monster, *weapon;
 
 object *
 get_thrown_at_monster(obj, dir, row, col)
-object *obj;
-short dir;
-short *row, *col;
+       object *obj;
+       short dir;
+       short *row, *col;
 {
        short orow, ocol;
        short i, ch;
@@ -199,9 +204,10 @@ short *row, *col;
        return(0);
 }
 
+void
 flop_weapon(weapon, row, col)
-object *weapon;
-short row, col;
+       object *weapon;
+       short row, col;
 {
        object *new_weapon, *monster;
        short i = 0;
@@ -235,7 +241,8 @@ short row, col;
                        dch = get_dungeon_char(row, col);
                        if (mon) {
                                mch = mvinch(row, col);
-                               if (monster = object_at(&level_monsters, row, col)) {
+                               if ((monster = object_at(&level_monsters,
+                                   row, col)) != NULL) {
                                        monster->trail_char = dch;
                                }
                                if ((mch < 'A') || (mch > 'Z')) {
@@ -258,10 +265,11 @@ short row, col;
        }
 }
 
+void
 rand_around(i, r, c)
-short i, *r, *c;
+       short i, *r, *c;
 {
-       static char* pos = "\010\007\001\003\004\005\002\006\0";
+       static char pos[] = "\010\007\001\003\004\005\002\006\0";
        static short row, col;
        short j;