* Copyright (c) 1983 Regents of the University of California.
* Redistribution and use in source and binary forms are permitted
* provided that this notice is preserved and that due credit is given
* to the University of California at Berkeley. The name of the University
* may not be used to endorse or promote products derived from this
* software without specific prior written permission. This software
* is provided ``as is'' without express or implied warranty.
static char sccsid
[] = "@(#)dr_main.c 5.3 (Berkeley) %G%";
register struct ship
*sp
;
(void) signal(SIGINT
, SIG_IGN
);
(void) signal(SIGQUIT
, SIG_IGN
);
(void) signal(SIGTSTP
, SIG_IGN
);
(void) setruid(geteuid());
if (game
< 0 || game
>= NSCENE
) {
fprintf(stderr
, "DRIVER: Bad game number %d\n", game
);
perror("driver: syncfile");
for (n
= 0; n
< NNATION
; n
++)
(sp
->file
= (struct File
*)calloc(1, sizeof (struct File
))) == NULL
) {
(void) fprintf(stderr
, "DRIVER: Out of memory.\n");
sp
->file
->index
= sp
- SHIP(0);
sp
->file
->loadL
= L_ROUND
;
sp
->file
->loadR
= L_ROUND
;
sp
->file
->readyR
= R_LOADED
|R_INITIAL
;
sp
->file
->readyL
= R_LOADED
|R_INITIAL
;
sp
->file
->stern
= nat
[sp
->nationality
]++;
sp
->file
->dir
= sp
->shipdir
;
sp
->file
->row
= sp
->shiprow
;
sp
->file
->col
= sp
->shipcol
;
windspeed
= cc
->windspeed
;