-/* $NetBSD: initquad.c,v 1.4 1997/10/12 21:24:55 christos Exp $ */
+/* $NetBSD: initquad.c,v 1.7 2009/05/24 21:44:56 dholland Exp $ */
/*
* Copyright (c) 1980, 1993
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
#if 0
static char sccsid[] = "@(#)initquad.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: initquad.c,v 1.4 1997/10/12 21:24:55 christos Exp $");
+__RCSID("$NetBSD: initquad.c,v 1.7 2009/05/24 21:44:56 dholland Exp $");
#endif
#endif /* not lint */
*/
void
-initquad(f)
-int f;
+initquad(int f)
{
int i, j;
int rx, ry;
nholes = q->holes;
/* have we blundered into a battle zone w/ shields down? */
- if (Etc.nkling > 0 && !f)
- {
+ if (Etc.nkling > 0 && !f) {
printf("Condition RED\n");
Ship.cond = RED;
if (!damaged(COMPUTER))
Sect[Ship.sectx][Ship.secty] = Ship.ship;
/* initialize Klingons */
- for (i = 0; i < Etc.nkling; i++)
- {
+ for (i = 0; i < Etc.nkling; i++) {
sector(&rx, &ry);
Sect[rx][ry] = KLINGON;
Etc.klingon[i].x = rx;
compkldist(1);
/* initialize star base */
- if (nbases > 0)
- {
+ if (nbases > 0) {
sector(&rx, &ry);
Sect[rx][ry] = BASE;
Etc.starbase.x = rx;
}
/* initialize inhabited starsystem */
- if (q->qsystemname != 0)
- {
+ if (q->qsystemname != 0) {
sector(&rx, &ry);
Sect[rx][ry] = INHABIT;
nstars -= 1;
}
/* initialize black holes */
- for (i = 0; i < nholes; i++)
- {
+ for (i = 0; i < nholes; i++) {
sector(&rx, &ry);
Sect[rx][ry] = HOLE;
}
/* initialize stars */
- for (i = 0; i < nstars; i++)
- {
+ for (i = 0; i < nstars; i++) {
sector(&rx, &ry);
Sect[rx][ry] = STAR;
}
void
-sector(x, y)
-int *x, *y;
+sector(int *x, int *y)
{
int i, j;
- do
- {
+ do {
i = ranf(NSECTS);
j = ranf(NSECTS);
} while (Sect[i][j] != EMPTY);