summaryrefslogtreecommitdiffstats
path: root/hunt/huntd/expl.c
diff options
context:
space:
mode:
authordholland <dholland@NetBSD.org>2009-07-04 04:29:54 +0000
committerdholland <dholland@NetBSD.org>2009-07-04 04:29:54 +0000
commit04000177d6ff81237366452ab49b73a49309a5f6 (patch)
tree9e0f261dbec435e9fcc524060739895af8f241ce /hunt/huntd/expl.c
parent7aec9acedc86967b72d2679d392dc7d338b52ab4 (diff)
downloadbsdgames-darwin-04000177d6ff81237366452ab49b73a49309a5f6.tar.gz
bsdgames-darwin-04000177d6ff81237366452ab49b73a49309a5f6.zip
Whitespace.
Diffstat (limited to 'hunt/huntd/expl.c')
-rw-r--r--hunt/huntd/expl.c90
1 files changed, 45 insertions, 45 deletions
diff --git a/hunt/huntd/expl.c b/hunt/huntd/expl.c
index 659d3507..364ef576 100644
--- a/hunt/huntd/expl.c
+++ b/hunt/huntd/expl.c
@@ -1,4 +1,4 @@
-/* $NetBSD: expl.c,v 1.6 2009/07/04 02:37:20 dholland Exp $ */
+/* $NetBSD: expl.c,v 1.7 2009/07/04 04:29:54 dholland Exp $ */
/*
* Copyright (c) 1983-2003, Regents of the University of California.
* All rights reserved.
@@ -32,13 +32,13 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: expl.c,v 1.6 2009/07/04 02:37:20 dholland Exp $");
+__RCSID("$NetBSD: expl.c,v 1.7 2009/07/04 04:29:54 dholland Exp $");
#endif /* not lint */
-# include <stdlib.h>
-# include "hunt.h"
+#include <stdlib.h>
+#include "hunt.h"
-static void remove_wall(int, int);
+static void remove_wall(int, int);
/*
@@ -48,8 +48,8 @@ static void remove_wall(int, int);
void
showexpl(int y, int x, char type)
{
- PLAYER *pp;
- EXPL *ep;
+ PLAYER *pp;
+ EXPL *ep;
if (y < 0 || y >= HEIGHT)
return;
@@ -72,7 +72,7 @@ showexpl(int y, int x, char type)
cgoto(pp, y, x);
outch(pp, type);
}
-# ifdef MONITOR
+#ifdef MONITOR
for (pp = Monitor; pp < End_monitor; pp++) {
if (pp->p_maze[y][x] == type)
continue;
@@ -80,18 +80,18 @@ showexpl(int y, int x, char type)
cgoto(pp, y, x);
outch(pp, type);
}
-# endif
+#endif
switch (Maze[y][x]) {
case WALL1:
case WALL2:
case WALL3:
-# ifdef RANDOM
+#ifdef RANDOM
case DOOR:
-# endif
-# ifdef REFLECT
+#endif
+#ifdef REFLECT
case WALL4:
case WALL5:
-# endif
+#endif
if (y >= UBOUND && y < DBOUND && x >= LBOUND && x < RBOUND)
remove_wall(y, x);
break;
@@ -106,11 +106,11 @@ showexpl(int y, int x, char type)
void
rollexpl(void)
{
- EXPL *ep;
- PLAYER *pp;
- int y, x;
- char c;
- EXPL *nextep;
+ EXPL *ep;
+ PLAYER *pp;
+ int y, x;
+ char c;
+ EXPL *nextep;
for (ep = Expl[EXPLEN - 1]; ep != NULL; ep = nextep) {
nextep = ep->e_next;
@@ -126,10 +126,10 @@ rollexpl(void)
cgoto(pp, y, x);
outch(pp, c);
}
-# ifdef MONITOR
+#ifdef MONITOR
for (pp = Monitor; pp < End_monitor; pp++)
check(pp, y, x);
-# endif
+#endif
free(ep);
}
for (x = EXPLEN - 1; x > 0; x--)
@@ -139,10 +139,10 @@ rollexpl(void)
/* There's about 700 walls in the initial maze. So we pick a number
* that keeps the maze relatively full. */
-# define MAXREMOVE 40
+#define MAXREMOVE 40
-static REGEN removed[MAXREMOVE];
-static REGEN *rem_index = removed;
+static REGEN removed[MAXREMOVE];
+static REGEN *rem_index = removed;
/*
* remove_wall - add a location where the wall was blown away.
@@ -152,17 +152,17 @@ static REGEN *rem_index = removed;
static void
remove_wall(int y, int x)
{
- REGEN *r;
-# if defined(MONITOR) || defined(FLY)
- PLAYER *pp;
-# endif
-# ifdef FLY
- char save_char = 0;
-# endif
+ REGEN *r;
+#if defined(MONITOR) || defined(FLY)
+ PLAYER *pp;
+#endif
+#ifdef FLY
+ char save_char = 0;
+#endif
r = rem_index;
while (r->r_y != 0) {
-# ifdef FLY
+#ifdef FLY
switch (Maze[r->r_y][r->r_x]) {
case SPACE:
case LEFTS:
@@ -173,10 +173,10 @@ remove_wall(int y, int x)
save_char = Maze[r->r_y][r->r_x];
goto found;
}
-# else
+#else
if (Maze[r->r_y][r->r_x] == SPACE)
break;
-# endif
+#endif
if (++r >= &removed[MAXREMOVE])
r = removed;
}
@@ -184,7 +184,7 @@ remove_wall(int y, int x)
found:
if (r->r_y != 0) {
/* Slot being used, put back this wall */
-# ifdef FLY
+#ifdef FLY
if (save_char == SPACE)
Maze[r->r_y][r->r_x] = Orig_maze[r->r_y][r->r_x];
else {
@@ -201,21 +201,21 @@ found:
Maze[r->r_y][r->r_x] = FLYER;
showexpl(r->r_y, r->r_x, FLYER);
}
-# else
+#else
Maze[r->r_y][r->r_x] = Orig_maze[r->r_y][r->r_x];
-# endif
-# ifdef RANDOM
+#endif
+#ifdef RANDOM
if (rand_num(100) == 0)
Maze[r->r_y][r->r_x] = DOOR;
-# endif
-# ifdef REFLECT
+#endif
+#ifdef REFLECT
if (rand_num(100) == 0) /* one percent of the time */
Maze[r->r_y][r->r_x] = WALL4;
-# endif
-# ifdef MONITOR
+#endif
+#ifdef MONITOR
for (pp = Monitor; pp < End_monitor; pp++)
check(pp, r->r_y, r->r_x);
-# endif
+#endif
}
r->r_y = y;
@@ -226,10 +226,10 @@ found:
rem_index = r;
Maze[y][x] = SPACE;
-# ifdef MONITOR
+#ifdef MONITOR
for (pp = Monitor; pp < End_monitor; pp++)
check(pp, y, x);
-# endif
+#endif
}
/*
@@ -239,7 +239,7 @@ found:
void
clearwalls(void)
{
- REGEN *rp;
+ REGEN *rp;
for (rp = removed; rp < &removed[MAXREMOVE]; rp++)
rp->r_y = 0;