streamline PR #1124

Get rid of an extra 'if'.
This commit is contained in:
PatR
2023-11-09 21:58:58 -08:00
parent 5481657792
commit d0ade3b085
+8 -11
View File
@@ -1,4 +1,4 @@
/* NetHack 3.7 pray.c $NHDT-Date: 1684138081 2023/05/15 08:08:01 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.194 $ */ /* NetHack 3.7 pray.c $NHDT-Date: 1699595930 2023/11/10 05:58:50 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.202 $ */
/* Copyright (c) Benson I. Margulies, Mike Stephenson, Steve Linhart, 1989. */ /* Copyright (c) Benson I. Margulies, Mike Stephenson, Steve Linhart, 1989. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -1793,10 +1793,10 @@ bestow_artifact(void)
int int
dosacrifice(void) dosacrifice(void)
{ {
register struct obj *otmp; struct obj *otmp;
int value = 0;
boolean highaltar; boolean highaltar;
aligntyp altaralign = a_align(u.ux, u.uy); aligntyp altaralign = a_align(u.ux, u.uy);
int value = 0;
if (!on_altar() || u.uswallow) { if (!on_altar() || u.uswallow) {
You("are not standing on an altar."); You("are not standing on an altar.");
@@ -1834,13 +1834,8 @@ dosacrifice(void)
*/ */
#define MAXVALUE 24 /* Highest corpse value (besides Wiz) */ #define MAXVALUE 24 /* Highest corpse value (besides Wiz) */
if (otmp->otyp != CORPSE) { if (otmp->otyp == CORPSE) {
pline1(nothing_happens); struct permonst *ptr = &mons[otmp->corpsenm];
return ECMD_TIME;
}
{
register struct permonst *ptr = &mons[otmp->corpsenm];
struct monst *mtmp; struct monst *mtmp;
/* KMH, conduct */ /* KMH, conduct */
@@ -1923,7 +1918,9 @@ dosacrifice(void)
value += 3; value += 3;
} }
} }
} /* corpse */ } else { /* !corpse */
; /* value==0 which is what we want for non-corpse */
} /* ?corpse */
if (value == 0) { if (value == 0) {
pline1(nothing_happens); pline1(nothing_happens);