diff options
author | Paul Janzen <pjanzen@cvs.openbsd.org> | 1998-09-13 01:30:35 +0000 |
---|---|---|
committer | Paul Janzen <pjanzen@cvs.openbsd.org> | 1998-09-13 01:30:35 +0000 |
commit | b3888d9681fb2a06862951f70b6f5db8182b5ffe (patch) | |
tree | 876612919934f0fdcfa9d4e8cb8ffaac4936bd32 /games/battlestar/init.c | |
parent | 59960cac708b617a25b3844645eb144553ea4562 (diff) |
NetBSD merge, numerous patches from jsm28@cam.ac.uk, spelling fixes, and
correct gid revoke.
Diffstat (limited to 'games/battlestar/init.c')
-rw-r--r-- | games/battlestar/init.c | 41 |
1 files changed, 17 insertions, 24 deletions
diff --git a/games/battlestar/init.c b/games/battlestar/init.c index 4dc79b982f1..73cfcc3fc6f 100644 --- a/games/battlestar/init.c +++ b/games/battlestar/init.c @@ -1,4 +1,4 @@ -/* $OpenBSD: init.c,v 1.4 1997/09/01 18:13:19 millert Exp $ */ +/* $OpenBSD: init.c,v 1.5 1998/09/13 01:30:32 pjanzen Exp $ */ /* $NetBSD: init.c,v 1.4 1995/03/21 15:07:35 cgd Exp $ */ /* @@ -38,35 +38,28 @@ #if 0 static char sccsid[] = "@(#)init.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$NetBSD: init.c,v 1.4 1995/03/21 15:07:35 cgd Exp $"; +static char rcsid[] = "$OpenBSD: init.c,v 1.5 1998/09/13 01:30:32 pjanzen Exp $"; #endif #endif /* not lint */ -#include <unistd.h> -#include <sys/types.h> #include "extern.h" -#include <pwd.h> - -int checkout __P((char *)); -void getutmp __P((char *)); -int wizard __P((char *)); void initialize(startup) - char startup; + char startup; { - register struct objs *p; + struct objs *p; puts("Version 4.2, fall 1984."); puts("First Adventure game written by His Lordship, the honorable"); puts("Admiral D.W. Riggle\n"); - srand(getpid()); + location = dayfile; + srandom(getpid()); getutmp(uname); wordinit(); if (startup) { - location = dayfile; direction = NORTH; - btime = 0; + ourtime = 0; snooze = CYCLE * 1.5; position = 22; setbit(wear, PAJAMAS); @@ -82,7 +75,7 @@ initialize(startup) void getutmp(uname) - char *uname; + char *uname; { struct passwd *ptr; @@ -90,7 +83,7 @@ getutmp(uname) strcpy(uname, ptr ? ptr->pw_name : ""); } -char *list[] = { /* hereditary wizards */ +char *list[] = { /* hereditary wizards */ "riggle", "chris", "edward", @@ -101,7 +94,7 @@ char *list[] = { /* hereditary wizards */ 0 }; -char *badguys[] = { +char *badguys[] = { "wnj", "root", "ted", @@ -110,20 +103,20 @@ char *badguys[] = { int wizard(uname) - char *uname; + char *uname; { - char flag; + int flag; - if (flag = checkout(uname)) + if ((flag = checkout(uname)) != 0) printf("You are the Great wizard %s.\n", uname); return flag; } int checkout(uname) - register char *uname; + char *uname; { - register char **ptr; + char **ptr; for (ptr = list; *ptr; ptr++) if (strcmp(*ptr, uname) == 0) @@ -131,11 +124,11 @@ checkout(uname) for (ptr = badguys; *ptr; ptr++) if (strcmp(*ptr, uname) == 0) { printf("You are the Poor anti-wizard %s. Good Luck!\n", - uname); + uname); if (location != NULL) { CUMBER = 3; WEIGHT = 9; /* that'll get him! */ - bclock = 10; + ourclock = 10; setbit(location[7].objects, WOODSMAN); /* viper room */ setbit(location[20].objects, WOODSMAN); /* laser " */ setbit(location[13].objects, DARK); /* amulet " */ |