X-Git-Url: https://git.cameronkatri.com/bsdgames-darwin.git/blobdiff_plain/55c4a511be47d16c259623bf0f76ddd0df0a42ac..0a101f8439154af1932c3ec996ca202cb5888f97:/robots/make_level.c diff --git a/robots/make_level.c b/robots/make_level.c index 998155db..a88ecb50 100644 --- a/robots/make_level.c +++ b/robots/make_level.c @@ -1,4 +1,4 @@ -/* $NetBSD: make_level.c,v 1.3 1995/04/22 10:08:56 cgd Exp $ */ +/* $NetBSD: make_level.c,v 1.10 2009/07/20 06:39:06 dholland Exp $ */ /* * Copyright (c) 1980, 1993 @@ -12,11 +12,7 @@ * 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. * @@ -33,26 +29,29 @@ * SUCH DAMAGE. */ +#include #ifndef lint #if 0 static char sccsid[] = "@(#)make_level.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$NetBSD: make_level.c,v 1.3 1995/04/22 10:08:56 cgd Exp $"; +__RCSID("$NetBSD: make_level.c,v 1.10 2009/07/20 06:39:06 dholland Exp $"); #endif #endif /* not lint */ -# include "robots.h" +#include +#include +#include "robots.h" /* * make_level: * Make the current level */ -make_level() +void +make_level(void) { - register int i; - register COORD *cp; - register WINDOW *wp; - register int x, *endp; + int i; + COORD *cp; + int x; reset_count(); for (i = 1; i < Y_FIELDSIZE; i++) @@ -62,14 +61,14 @@ make_level() if (My_pos.y > 0) mvaddch(My_pos.y, My_pos.x, ' '); - Waiting = FALSE; + Waiting = false; Wait_bonus = 0; leaveok(stdscr, FALSE); for (cp = Robots; cp < &Robots[MAXROBOTS]; cp++) cp->y = -1; My_pos.y = -1; - bzero(Field, sizeof Field); + memset(Field, 0, sizeof Field); Min.y = Y_FIELDSIZE; Min.x = X_FIELDSIZE; Max.y = 0; @@ -77,6 +76,8 @@ make_level() if ((i = Level * 10) > MAXROBOTS) i = MAXROBOTS; Num_robots = i; + memset(Scrap, 0, sizeof(Scrap[0]) * MAXROBOTS); + Num_scrap = 0; while (i-- > 0) { cp = rnd_pos(); Robots[i] = *cp;