From 53a929e65ca35fc4d62ba126188e4b830f5abfeb Mon Sep 17 00:00:00 2001 From: ache Date: Sat, 3 Dec 1994 02:27:40 +0000 Subject: Prevent core dump for root Obtained from: partially from 1.1.5.1 --- games/battlestar/init.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'games') diff --git a/games/battlestar/init.c b/games/battlestar/init.c index 0b67b538..d0359de 100644 --- a/games/battlestar/init.c +++ b/games/battlestar/init.c @@ -50,10 +50,11 @@ initialize(startup) puts("Admiral D.W. Riggle\n"); srand(getpid()); getutmp(uname); + if (startup) + location = dayfile; wiz = wizard(uname); wordinit(); if (startup) { - location = dayfile; direction = NORTH; time = 0; snooze = CYCLE * 1.5; @@ -117,13 +118,15 @@ checkout(uname) if (strcmp(*ptr, uname) == 0) { printf("You are the Poor anti-wizard %s. Good Luck!\n", uname); - CUMBER = 3; - WEIGHT = 9; /* that'll get him! */ - clock = 10; - setbit(location[7].objects, WOODSMAN); /* viper room */ - setbit(location[20].objects, WOODSMAN); /* laser " */ - setbit(location[13].objects, DARK); /* amulet " */ - setbit(location[8].objects, ELF); /* closet */ + if (location != NULL) { + CUMBER = 3; + WEIGHT = 9; /* that'll get him! */ + clock = 10; + setbit(location[7].objects, WOODSMAN); /* viper room */ + setbit(location[20].objects, WOODSMAN); /* laser " */ + setbit(location[13].objects, DARK); /* amulet " */ + setbit(location[8].objects, ELF); /* closet */ + } return 0; /* anything else, Chris? */ } return 0; -- cgit v1.1