From 0c30e1edc0b2a32d2290a4175a475d7a33377fad Mon Sep 17 00:00:00 2001 From: Edward Wang Date: Sat, 29 Oct 1983 05:15:24 -0800 Subject: [PATCH] multiple driver locations, and initial pos bug. SCCS-vsn: games/sail/pl_1.c 1.15 SCCS-vsn: games/sail/machdep.h 1.10 --- usr/src/games/sail/machdep.h | 7 ++++--- usr/src/games/sail/pl_1.c | 24 ++++++++++-------------- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/usr/src/games/sail/machdep.h b/usr/src/games/sail/machdep.h index 9aa7f80698..22b7ee4815 100644 --- a/usr/src/games/sail/machdep.h +++ b/usr/src/games/sail/machdep.h @@ -1,9 +1,10 @@ /* - * sccsid = "@(#)machdep.h 1.9 %G%"; + * sccsid = "@(#)machdep.h 1.10 %G%"; */ #define LOGFILE "/usr/games/lib/saillog" -#define DRIVER "/usr/games/lib/saildriver" -#define DEBUGDRIVER "driver" +#define DRIVER1 "driver" +#define DRIVER2 "/usr/games/lib/saildriver" +#define DRIVER3 "/usr/public/.driver" #define DRIVERNAME "driver" #define SAILLOGDEF 0 /* don't look up usernames */ #define SETUID /* player and driver run setuid */ diff --git a/usr/src/games/sail/pl_1.c b/usr/src/games/sail/pl_1.c index e246657c07..4be745c3dd 100644 --- a/usr/src/games/sail/pl_1.c +++ b/usr/src/games/sail/pl_1.c @@ -1,5 +1,5 @@ #ifndef lint -static char *sccsid = "@(#)pl_1.c 1.14 83/10/28"; +static char *sccsid = "@(#)pl_1.c 1.15 83/10/28"; #endif #include "player.h" @@ -96,7 +96,12 @@ reprint: exit(0); } sp->file->stern = nat[sp->nationality]++; + sp->file->dir = sp->shipdir; + sp->file->row = sp->shiprow; + sp->file->col = sp->shipcol; } + windspeed = cc->windspeed; + winddir = cc->winddir; if (active) { (void) puts("Synchronizing with the other players..."); @@ -209,23 +214,14 @@ reprint: char num[10]; (void) sprintf(num, "%d", game); if (!fork()) { - if (debug) - execl(DEBUGDRIVER, DRIVERNAME, num, 0); - else - execl(DRIVER, DRIVERNAME, num, 0); - perror(DRIVER); + execl(DRIVER1, DRIVERNAME, num, 0); + execl(DRIVER2, DRIVERNAME, num, 0); + execl(DRIVER3, DRIVERNAME, num, 0); + perror(DRIVERNAME); exit(1); } } - foreachship(sp) { - sp->file->dir = sp->shipdir; - sp->file->row = sp->shiprow; - sp->file->col = sp->shipcol; - } - windspeed = cc->windspeed; - winddir = cc->winddir; - initscreen(); draw_board(); -- 2.20.1