]> git.cameronkatri.com Git - bsdgames-darwin.git/blobdiff - rogue/throw.c
revert previous and don't parse octal
[bsdgames-darwin.git] / rogue / throw.c
index 0312503c6c253af9c24df708b254d05e08aa9bfb..93c88c5a2f8a3d4af51fe68381bc86acbb44df51 100644 (file)
@@ -1,4 +1,4 @@
-/*     $NetBSD: throw.c,v 1.8 2007/12/27 23:53:01 dholland Exp $       */
+/*     $NetBSD: throw.c,v 1.12 2011/05/23 23:01:17 joerg Exp $ */
 
 /*
  * Copyright (c) 1988, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)throw.c    8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: throw.c,v 1.8 2007/12/27 23:53:01 dholland Exp $");
+__RCSID("$NetBSD: throw.c,v 1.12 2011/05/23 23:01:17 joerg Exp $");
 #endif
 #endif /* not lint */
 
@@ -55,8 +55,12 @@ __RCSID("$NetBSD: throw.c,v 1.8 2007/12/27 23:53:01 dholland Exp $");
 
 #include "rogue.h"
 
+static void flop_weapon(object *, short, short);
+static object *get_thrown_at_monster(object *, short, short *, short *);
+static boolean throw_at_monster(object *, object *);
+
 void
-throw()
+throw(void)
 {
        short wch, d;
        boolean first_miss = 1;
@@ -85,7 +89,7 @@ throw()
                return;
        }
        if ((weapon->in_use_flags & BEING_USED) && weapon->is_cursed) {
-               messagef(0, curse_message);
+               messagef(0, "%s", curse_message);
                return;
        }
        row = rogue.row; col = rogue.col;
@@ -120,8 +124,7 @@ throw()
 }
 
 boolean
-throw_at_monster(monster, weapon)
-       object *monster, *weapon;
+throw_at_monster(object *monster, object *weapon)
 {
        short damage, hit_chance;
        short t;
@@ -146,20 +149,17 @@ throw_at_monster(monster, weapon)
        weapon->quantity = t;
 
        if (!rand_percent(hit_chance)) {
-               (void) strlcat(hit_message, "misses  ", HIT_MESSAGE_SIZE);
+               (void)strlcat(hit_message, "misses  ", HIT_MESSAGE_SIZE);
                return(0);
        }
        s_con_mon(monster);
-       (void) strlcat(hit_message, "hit  ", HIT_MESSAGE_SIZE);
-       (void) mon_damage(monster, damage);
+       (void)strlcat(hit_message, "hit  ", HIT_MESSAGE_SIZE);
+       (void)mon_damage(monster, damage);
        return(1);
 }
 
 object *
-get_thrown_at_monster(obj, dir, row, col)
-       object *obj;
-       short dir;
-       short *row, *col;
+get_thrown_at_monster(object *obj, short dir, short *row, short *col)
 {
        short orow, ocol;
        short i, ch;
@@ -201,9 +201,7 @@ get_thrown_at_monster(obj, dir, row, col)
 }
 
 void
-flop_weapon(weapon, row, col)
-       object *weapon;
-       short row, col;
+flop_weapon(object *weapon, short row, short col)
 {
        object *new_weapon, *monster;
        short i = 0;
@@ -263,8 +261,7 @@ flop_weapon(weapon, row, col)
 }
 
 void
-rand_around(i, r, c)
-       short i, *r, *c;
+rand_around(short i, short *r, short *c)
 {
        static char pos[] = "\010\007\001\003\004\005\002\006\0";
        static short row, col;