]> git.cameronkatri.com Git - bsdgames-darwin.git/blobdiff - sail/dr_2.c
The patch below improves the security of the game atc(6), by having it
[bsdgames-darwin.git] / sail / dr_2.c
index d44e82463447ef7b8b04b557ae1a736e673a8d62..53730515bf989fde851c3710c9a69fb1d683ba04 100644 (file)
@@ -1,4 +1,4 @@
-/*     $NetBSD: dr_2.c,v 1.5 1997/10/13 19:43:23 christos Exp $        */
+/*     $NetBSD: dr_2.c,v 1.9 1999/02/10 00:45:45 hubertf Exp $ */
 
 /*
  * Copyright (c) 1983, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)dr_2.c     8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: dr_2.c,v 1.5 1997/10/13 19:43:23 christos Exp $");
+__RCSID("$NetBSD: dr_2.c,v 1.9 1999/02/10 00:45:45 hubertf Exp $");
 #endif
 #endif /* not lint */
 
@@ -93,19 +93,19 @@ checkup()
                        continue;
                if (die() < 5)
                        continue;
-               Write(sink == 1 ? W_SINK : W_EXPLODE, sp, 0, 2, 0, 0, 0);
-               Write(W_DIR, sp, 0, 0, 0, 0, 0);
+               Write(sink == 1 ? W_SINK : W_EXPLODE, sp, 2, 0, 0, 0);
+               Write(W_DIR, sp, 0, 0, 0, 0);
                if (snagged(sp))
                        foreachship(sq)
                                cleansnag(sp, sq, 1);
                if (sink != 1) {
-                       makesignal(sp, "exploding!", (struct ship *)0);
+                       makemsg(sp, "exploding!");
                        foreachship(sq) {
                                if (sp != sq && sq->file->dir && range(sp, sq) < 4)
                                        table(RIGGING, L_EXPLODE, sp->specs->guns/13, sq, sp, 6);
                        }
                } else
-                       makesignal(sp, "sinking!", (struct ship *)0);
+                       makemsg(sp, "sinking!");
        }
 }
 
@@ -120,10 +120,9 @@ prizecheck()
                if (sp->file->struck || sp->file->dir == 0)
                        continue;
                if (sp->specs->crew1 + sp->specs->crew2 + sp->specs->crew3 > sp->file->pcrew * 6) {
-                       Write(W_SIGNAL, sp, 1,
-                               (long)"prize crew overthrown", 0, 0, 0);
-                       Write(W_POINTS, sp->file->captured, 0, sp->file->captured->file->points - 2 * sp->specs->pts, 0, 0, 0);
-                       Write(W_CAPTURED, sp, 0, -1, 0, 0, 0);
+                       Writestr(W_SIGNAL, sp, "prize crew overthrown");
+                       Write(W_POINTS, sp->file->captured, sp->file->captured->file->points - 2 * sp->specs->pts, 0, 0, 0);
+                       Write(W_CAPTURED, sp, -1, 0, 0, 0);
                }
        }
 }
@@ -170,7 +169,7 @@ char onlytemp;
        row = fp->row;
        col = fp->col;
        drift = fp->drift;
-       move(movement, ship, &fp->dir, &fp->row, &fp->col, &drift);
+       move_ship(movement, ship, &fp->dir, &fp->row, &fp->col, &drift);
        if (!*movement)
                (void) strcpy(movement, "d");
 
@@ -190,7 +189,7 @@ char onlytemp;
 }
 
 void
-move(p, ship, dir, row, col, drift)
+move_ship(p, ship, dir, row, col, drift)
 char *p;
 struct ship *ship;
 unsigned char *dir;
@@ -237,7 +236,7 @@ char *drift;
 void
 try(command, temp, ma, ta, af, vma, dir, f, t, high, rakeme)
 struct ship *f, *t;
-int ma, ta, af, *high, rakeme;
+int ma, ta, af, vma, dir, *high, rakeme;
 char command[], temp[];
 {
        int new, n;