Repair algorithm fixed.
[unix-history] / usr / src / games / sail / pl_5.c
index 0ea2f2f..8f726a1 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char *sccsid = "@(#)pl_5.c      1.2 83/10/28";
+static char *sccsid = "@(#)pl_5.c      2.5 83/12/21";
 #endif
 
 #include "player.h"
 #endif
 
 #include "player.h"
@@ -106,7 +106,7 @@ acceptmove()
                (void) strcpy(movebuf, buf);
        else
                (void) strcpy(movebuf, "d");
                (void) strcpy(movebuf, buf);
        else
                (void) strcpy(movebuf, "d");
-       Write(W_LAST, ms, 1, (int)movebuf, 0, 0, 0);
+       Write(W_MOVE, ms, 1, (int)movebuf, 0, 0, 0);
        Signal("Helm: %s.", (struct ship *)0, movebuf);
 }
 
        Signal("Helm: %s.", (struct ship *)0, movebuf);
 }
 
@@ -123,11 +123,11 @@ acceptboard()
        crew[2] = mc->crew3;
        for (n = 0; n < NBP; n++) {
                if (mf->OBP[n].turnsent)
        crew[2] = mc->crew3;
        for (n = 0; n < NBP; n++) {
                if (mf->OBP[n].turnsent)
-                           men += mf->OBP[n].turnsent;
+                           men += mf->OBP[n].mensent;
        }
        for (n = 0; n < NBP; n++) {
                if (mf->DBP[n].turnsent)
        }
        for (n = 0; n < NBP; n++) {
                if (mf->DBP[n].turnsent)
-                           men += mf->DBP[n].turnsent;
+                           men += mf->DBP[n].mensent;
        }
        if (men) {
                crew[0] = men/100 ? 0 : crew[0] != 0;
        }
        if (men) {
                crew[0] = men/100 ? 0 : crew[0] != 0;
@@ -157,7 +157,9 @@ acceptboard()
                        (struct ship *)0, 1);
                parties(crew, ms, 1, c);
        }
                        (struct ship *)0, 1);
                parties(crew, ms, 1, c);
        }
+       blockalarm();
        draw_slot();
        draw_slot();
+       unblockalarm();
 }
 
 parties(crew, to, isdefense, buf)
 }
 
 parties(crew, to, isdefense, buf)
@@ -189,7 +191,7 @@ char buf;
                                Signal("Sending all crew sections.",
                                        (struct ship *)0);
                        Write(isdefense ? W_DBP : W_OBP, ms, 0,
                                Signal("Sending all crew sections.",
                                        (struct ship *)0);
                        Write(isdefense ? W_DBP : W_OBP, ms, 0,
-                               j, turn, to-SHIP(0), men);
+                               j, turn, to->file->index, men);
                        if (isdefense) {
                                (void) wmove(slot_w, 2, 0);
                                for (k=0; k < NBP; k++)
                        if (isdefense) {
                                (void) wmove(slot_w, 2, 0);
                                for (k=0; k < NBP; k++)
@@ -210,7 +212,9 @@ char buf;
                                (void) mvwaddstr(slot_w, 1, 0, "OBP");
                                makesignal(ms, "boarding the %s (%c%c)", to);
                        }
                                (void) mvwaddstr(slot_w, 1, 0, "OBP");
                                makesignal(ms, "boarding the %s (%c%c)", to);
                        }
+                       blockalarm();
                        (void) wrefresh(slot_w);
                        (void) wrefresh(slot_w);
+                       unblockalarm();
                } else
                        Signal("Sending no crew sections.", (struct ship *)0);
        }
                } else
                        Signal("Sending no crew sections.", (struct ship *)0);
        }