From fb7a11c3477131517fdc1317620d26017958de24 Mon Sep 17 00:00:00 2001 From: mouse Date: Sun, 22 Apr 2007 02:09:02 +0000 Subject: Per PR 36185, OKed by martin@ --- larn/data.c | 22 +++++++++++----------- larn/io.c | 5 +++-- larn/main.c | 6 +++--- larn/monster.c | 16 ++++++++-------- larn/scores.c | 40 +++++++++++++++++++++++++++------------- 5 files changed, 52 insertions(+), 37 deletions(-) (limited to 'larn') diff --git a/larn/data.c b/larn/data.c index c0458889..81bef8d0 100644 --- a/larn/data.c +++ b/larn/data.c @@ -1,4 +1,4 @@ -/* $NetBSD: data.c,v 1.10 2003/08/07 09:37:23 agc Exp $ */ +/* $NetBSD: data.c,v 1.11 2007/04/22 02:09:02 mouse Exp $ */ /*- * Copyright (c) 1988 The Regents of the University of California. @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)data.c 5.3 (Berkeley) 5/13/91"; #else -__RCSID("$NetBSD: data.c,v 1.10 2003/08/07 09:37:23 agc Exp $"); +__RCSID("$NetBSD: data.c,v 1.11 2007/04/22 02:09:02 mouse Exp $"); #endif #endif /* not lint */ @@ -453,15 +453,15 @@ char *spelname[] = { char *speldescript[] = { /* 1 */ "generates a +2 protection field", - "creates and hurls a magic missile equivalent to a + 1 magic arrow", - "adds +2 to the casters dexterity", + "creates and hurls a magic missile equivalent to a +1 magic arrow", + "adds +2 to the caster's dexterity", "causes some monsters to go to sleep", "some monsters may be awed at your magnificence", "causes your hands to emit a screeching sound toward what they point", /* 7 */ "causes strands of sticky thread to entangle an enemy", - "adds +2 to the casters strength for a short term", - "the caster becomes aware of things around him", + "adds +2 to the caster's strength for a short term", + "the caster becomes aware of things in the vicinity", "restores some hp to the caster", "restores sight to one so unfortunate as to be blinded", "creates a monster near the caster appropriate for the location", @@ -471,20 +471,20 @@ char *speldescript[] = { "makes a ball of fire that burns on what it hits", "sends forth a cone of cold which freezes what it touches", "you can find out what this does for yourself", - "negates the ability of a monster to use his special abilities", - "speeds up the casters movements", + "negates the ability of a monster to use its special abilities", + "speeds up the caster's movements", "creates a fog of poisonous gas which kills all that is within it", "this changes rock to air", /* 22 */ "dries up water in the immediate vicinity", - "you finger will emit a lightning bolt when this spell is cast", + "your finger will emit a lightning bolt when this spell is cast", "subtracts hit points from both you and a monster", "this globe helps to protect the player from physical attack", "this creates an avalanche of H2O to flood the immediate chamber", "this is a holy spell and calls upon your god to back you up", /* 28 */ - "terrifies the monster so that hopefully he wont hit the magic user", - "the monster is frozen in his tracks if this is successful", + "terrifies the monster so that hopefully it won't hit the magic user", + "the monster is frozen in its tracks if this is successful", "all movement in the caverns ceases for a limited duration", "moves a particular monster around in the dungeon (hopefully away from you)", "this causes a curtain of fire to appear all around you", diff --git a/larn/io.c b/larn/io.c index e7446e67..cfac1054 100644 --- a/larn/io.c +++ b/larn/io.c @@ -1,4 +1,4 @@ -/* $NetBSD: io.c,v 1.16 2006/05/11 10:23:24 mrg Exp $ */ +/* $NetBSD: io.c,v 1.17 2007/04/22 02:09:02 mouse Exp $ */ /* * io.c Larn is copyrighted 1986 by Noah Morgan. @@ -62,7 +62,7 @@ */ #include #ifndef lint -__RCSID("$NetBSD: io.c,v 1.16 2006/05/11 10:23:24 mrg Exp $"); +__RCSID("$NetBSD: io.c,v 1.17 2007/04/22 02:09:02 mouse Exp $"); #endif /* not lint */ #include "header.h" @@ -572,6 +572,7 @@ int lcreat(str) char *str; { + lflush(); lpnt = lpbuf; lpend = lpbuf + BUFBIG; if (str == NULL) diff --git a/larn/main.c b/larn/main.c index f0dcaf1b..d556f7f4 100644 --- a/larn/main.c +++ b/larn/main.c @@ -1,9 +1,9 @@ -/* $NetBSD: main.c,v 1.17 2006/04/24 18:00:53 snj Exp $ */ +/* $NetBSD: main.c,v 1.18 2007/04/22 02:09:02 mouse Exp $ */ /* main.c */ #include #ifndef lint -__RCSID("$NetBSD: main.c,v 1.17 2006/04/24 18:00:53 snj Exp $"); +__RCSID("$NetBSD: main.c,v 1.18 2007/04/22 02:09:02 mouse Exp $"); #endif /* not lint */ #include @@ -808,7 +808,7 @@ parse() case ODARTRAP: case OTRAPARROW: case OTELEPORTER: - lprcat("\nIts "); + lprcat("\nIt's "); lprcat(objectname[item[i][j]]); flag++; }; diff --git a/larn/monster.c b/larn/monster.c index 972b67a9..7a3c54e2 100644 --- a/larn/monster.c +++ b/larn/monster.c @@ -1,4 +1,4 @@ -/* $NetBSD: monster.c,v 1.10 2006/03/19 00:37:15 christos Exp $ */ +/* $NetBSD: monster.c,v 1.11 2007/04/22 02:09:02 mouse Exp $ */ /* * monster.c Larn is copyrighted 1986 by Noah Morgan. @@ -100,7 +100,7 @@ */ #include #ifndef lint -__RCSID("$NetBSD: monster.c,v 1.10 2006/03/19 00:37:15 christos Exp $"); +__RCSID("$NetBSD: monster.c,v 1.11 2007/04/22 02:09:02 mouse Exp $"); #endif /* not lint */ #include @@ -740,7 +740,7 @@ direct(spnum, dam, str, arg) goto fool; } else { lastnum = 278; - lprintf(str, "spell caster (thats you)", (long) arg); + lprintf(str, "spell caster (that's you)", (long) arg); beep(); losehp(dam); return; @@ -800,7 +800,7 @@ godirect(spnum, dam, str, delay, cshow) } if ((x == playerx) && (y == playery)) { /* if energy hits player */ cursors(); - lprcat("\nYou are hit my your own magic!"); + lprcat("\nYou are hit by your own magic!"); beep(); lastnum = 278; losehp(dam); @@ -1215,7 +1215,7 @@ hitplayer(x, y) vxy(&x, &y); /* verify coordinates are within range */ lastnum = mster = mitem[x][y]; /* - * spirit naga's and poltergeist's do nothing if scarab of negate + * spirit nagas and poltergeists do nothing if scarab of negate * spirit */ if (c[NEGATESPIRIT] || c[SPIRITPRO]) @@ -1534,10 +1534,10 @@ spattack(x, xx, yy) if (j == 0) /* if rusting did not occur */ switch (m) { case OLEATHER: - p = "\nThe %s hit you -- Your lucky you have leather on"; + p = "\nThe %s hit you -- You're lucky you have leather on"; break; case OSSPLATE: - p = "\nThe %s hit you -- Your fortunate to have stainless steel armor!"; + p = "\nThe %s hit you -- You're fortunate to have stainless steel armor!"; break; } else { @@ -1550,7 +1550,7 @@ spattack(x, xx, yy) i = rnd(15) + 8 - c[AC]; spout: p = "\nThe %s breathes fire at you!"; if (c[FIRERESISTANCE]) - p = "\nThe %s's flame doesn't phase you!"; + p = "\nThe %s's flame doesn't faze you!"; else spout2: if (p) { lprintf(p, lastmonst); diff --git a/larn/scores.c b/larn/scores.c index 71d399e1..975afc7d 100644 --- a/larn/scores.c +++ b/larn/scores.c @@ -1,4 +1,4 @@ -/* $NetBSD: scores.c,v 1.12 2004/02/13 11:36:08 wiz Exp $ */ +/* $NetBSD: scores.c,v 1.13 2007/04/22 02:09:02 mouse Exp $ */ /* * scores.c Larn is copyrighted 1986 by Noah Morgan. @@ -26,7 +26,7 @@ */ #include #ifndef lint -__RCSID("$NetBSD: scores.c,v 1.12 2004/02/13 11:36:08 wiz Exp $"); +__RCSID("$NetBSD: scores.c,v 1.13 2007/04/22 02:09:02 mouse Exp $"); #endif /* not lint */ #include #include @@ -112,9 +112,11 @@ readboard() { int i; - seteuid(euid); + if (uid != euid) + seteuid(euid); i = lopen(scorefile); - seteuid(uid); + if (uid != euid) + seteuid(uid); if (i < 0) { lprcat("Can't read scoreboard\n"); lflush(); @@ -138,9 +140,11 @@ writeboard() int i; set_score_output(); - seteuid(euid); + if (uid != euid) + seteuid(euid); i = lcreat(scorefile); - seteuid(uid); + if (uid != euid) + seteuid(uid); if (i < 0) { lprcat("Can't write scoreboard\n"); lflush(); @@ -162,15 +166,18 @@ int makeboard() { int i; + set_score_output(); for (i = 0; i < SCORESIZE; i++) { winr[i].taxes = winr[i].score = sco[i].score = 0; winr[i].order = sco[i].order = i; } if (writeboard()) return (-1); - seteuid(euid); + if (uid != euid) + seteuid(euid); chmod(scorefile, 0660); - seteuid(uid); + if (uid != euid) + seteuid(uid); return (0); } @@ -226,6 +233,7 @@ paytaxes(x) * (Ughhhhh) */ winr[i].taxes -= amt; outstanding_taxes -= amt; + set_score_output(); if (writeboard() < 0) return (0); return (amt); @@ -643,7 +651,8 @@ invalid: set_score_output(); if ((wizard == 0) && (c[GOLD] > 0)) { /* wizards can't score */ #ifndef NOLOG - seteuid(euid); + if (uid != euid) + seteuid(euid); if (lappend(logfile) < 0) { /* append to file */ if (lcreat(logfile) < 0) { /* and can't create new * log file */ @@ -654,11 +663,14 @@ invalid: lflush(); exit(0); } - seteuid(euid); + if (uid != euid) + seteuid(euid); chmod(logfile, 0660); - seteuid(uid); + if (uid != euid) + seteuid(uid); } - seteuid(uid); + if (uid != euid) + seteuid(uid); strcpy(logg.who, loginname); logg.score = c[GOLD]; logg.diff = c[HARDGAME]; @@ -700,8 +712,10 @@ invalid: * game */ if (x != 257) { - if (sortboard()) + if (sortboard()) { + set_score_output(); scorerror = writeboard(); + } } } if ((x == 256) || (x == 257) || (f != 0)) -- cgit v1.2.3-56-ge451