* Copyright (c) 1983 Regents of the University of California.
* Redistribution and use in source and binary forms are permitted
* provided that the above copyright notice and this paragraph are
* duplicated in all such forms and that any documentation,
* advertising materials, and other materials related to such
* distribution and use acknowledge that the software was developed
* by the University of California, 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'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
static char sccsid
[] = "@(#)dr_main.c 5.4 (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
;