try to get the kernel printfs out before console starts reboot
[unix-history] / usr / src / games / sail / dr_2.c
index c4a7fe0..36dbb50 100644 (file)
@@ -1,6 +1,12 @@
+/*
+ * Copyright (c) 1983 Regents of the University of California.
+ * All rights reserved.  The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
+ */
+
 #ifndef lint
 #ifndef lint
-static char *sccsid = "@(#)dr_2.c      2.4 83/12/17";
-#endif
+static char sccsid[] = "@(#)dr_2.c     5.1 (Berkeley) %G%";
+#endif not lint
 
 #include "driver.h"
 
 
 #include "driver.h"
 
@@ -69,21 +75,17 @@ checkup()
 prizecheck()
 {
        register struct ship *sp;
 prizecheck()
 {
        register struct ship *sp;
-       register int prisoners, points;
 
        foreachship(sp) {
                if (sp->file->captured == 0)
                        continue;
                if (sp->file->struck || sp->file->dir == 0)
                        continue;
 
        foreachship(sp) {
                if (sp->file->captured == 0)
                        continue;
                if (sp->file->struck || sp->file->dir == 0)
                        continue;
-               prisoners = sp->specs->crew1 + sp->specs->crew2 + sp->specs->crew3;
-               if (prisoners > sp->file->pcrew * 6) {
-                       Write(W_CAPTURED, sp, 0, -1, 0, 0, 0);
+               if (sp->specs->crew1 + sp->specs->crew2 + sp->specs->crew3 > sp->file->pcrew * 6) {
                        Write(W_SIGNAL, sp, 1,
                                (int)"prize crew overthrown", 0, 0, 0);
                        Write(W_SIGNAL, sp, 1,
                                (int)"prize crew overthrown", 0, 0, 0);
-                       points = sp->file->captured->file->points
-                               - 2 * sp->specs->pts;
-                       Write(W_POINTS, sp->file->captured, 0, points, 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);
                }
        }
 }
                }
        }
 }
@@ -178,10 +180,8 @@ register char *drift;
                        break;
                }
        }
                        break;
                }
        }
-       if (!windspeed)
-               *drift = 1;
        if (!moved) {
        if (!moved) {
-               if (++*drift > 2) {
+               if (windspeed != 0 && ++*drift > 2) {
                        if (ship->specs->class >= 3 && !snagged(ship)
                            || (turn & 1) == 0) {
                                *row -= dr[winddir];
                        if (ship->specs->class >= 3 && !snagged(ship)
                            || (turn & 1) == 0) {
                                *row -= dr[winddir];