]> git.cameronkatri.com Git - bsdgames-darwin.git/blobdiff - sail/pl_5.c
factor: usage(): mark __dead
[bsdgames-darwin.git] / sail / pl_5.c
index f973b5092d9fcb924c75224d06cd14bbbb654db5..240ac0b9d90df16b786287762048e7a8749104c3 100644 (file)
@@ -1,4 +1,4 @@
-/*     $NetBSD: pl_5.c,v 1.21 2009/03/14 19:35:13 dholland Exp $       */
+/*     $NetBSD: pl_5.c,v 1.26 2019/02/03 03:19:25 mrg Exp $    */
 
 /*
  * Copyright (c) 1983, 1993
 #if 0
 static char sccsid[] = "@(#)pl_5.c     8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: pl_5.c,v 1.21 2009/03/14 19:35:13 dholland Exp $");
+__RCSID("$NetBSD: pl_5.c,v 1.26 2019/02/03 03:19:25 mrg Exp $");
 #endif
 #endif /* not lint */
 
 #include <ctype.h>
-#include <curses.h>
 #include <signal.h>
 #include <stdio.h>
 #include <string.h>
@@ -56,8 +55,8 @@ acceptmove(void)
 {
        int ta;
        int ma;
-       char af;
-       int moved = 0;
+       bool af;
+       bool moved = false;
        int vma, dir;
        char promptstr[60];
        char buf[60], last = '\0';
@@ -79,6 +78,7 @@ acceptmove(void)
                switch (*p) {
                case 'l':
                        dir -= 2;
+                       /* FALLTHROUGH */
                case 'r':
                        if (++dir == 0)
                                dir = 8;
@@ -116,7 +116,7 @@ acceptmove(void)
                                *p-- = '\0';
                        }
                        last = '0';
-                       moved = 1;
+                       moved = true;
                        ma -= *p - '0';
                        vma -= *p - '0';
                        if ((ta < 0 && moved) || (vma < 0 && moved))
@@ -133,7 +133,7 @@ acceptmove(void)
                Msg("Movement error.");
                if (ta < 0 && moved) {
                        if (mf->FS == 1) {
-                               Write(W_FS, ms, 0, 0, 0, 0);
+                               send_fs(ms, 0);
                                Msg("No hands to set full sails.");
                        }
                } else if (ma >= 0)
@@ -141,7 +141,7 @@ acceptmove(void)
        }
        if (af && !moved) {
                if (mf->FS == 1) {
-                       Write(W_FS, ms, 0, 0, 0, 0);
+                       send_fs(ms, 0);
                        Msg("No hands to set full sails.");
                }
        }
@@ -149,7 +149,7 @@ acceptmove(void)
                strlcpy(movebuf, buf, sizeof(movebuf));
        else
                strlcpy(movebuf, "d", sizeof(movebuf));
-       Writestr(W_MOVE, ms, movebuf);
+       send_move(ms, movebuf);
        Msg("Helm: %s.", movebuf);
 }
 
@@ -202,9 +202,6 @@ acceptboard(void)
                        (struct ship *)0, 1);
                parties(ms, crew, 1, c);
        }
-       blockalarm();
-       draw_slot();
-       unblockalarm();
 }
 
 static void
@@ -231,30 +228,22 @@ parties(struct ship *to, int *crew, int isdefense, int buf)
                        }
                        if (buf > '0')
                                Msg("Sending all crew sections.");
-                       Write(isdefense ? W_DBP : W_OBP, ms,
-                               j, turn, to->file->index, men);
                        if (isdefense) {
-                               wmove(slot_w, 2, 0);
+                               send_dbp(ms, j, turn, to->file->index, men);
+                       } else {
+                               send_obp(ms, j, turn, to->file->index, men);
+                       }
+                       if (isdefense) {
                                for (k=0; k < NBP; k++)
-                                       if (temp[k] && !crew[k])
-                                               waddch(slot_w, k + '1');
-                                       else
-                                               wmove(slot_w, 2, 1 + k);
-                               mvwaddstr(slot_w, 3, 0, "DBP");
+                                       display_set_dbp(k,
+                                                        temp[k] && !crew[k]);
                                makemsg(ms, "repelling boarders");
                        } else {
-                               wmove(slot_w, 0, 0);
                                for (k=0; k < NBP; k++)
-                                       if (temp[k] && !crew[k])
-                                               waddch(slot_w, k + '1');
-                                       else
-                                               wmove(slot_w, 0, 1 + k);
-                               mvwaddstr(slot_w, 1, 0, "OBP");
+                                       display_set_obp(k,
+                                                        temp[k] && !crew[k]);
                                makesignal(ms, "boarding the $$", to);
                        }
-                       blockalarm();
-                       wrefresh(slot_w);
-                       unblockalarm();
                } else
                        Msg("Sending no crew sections.");
        }