fix #1727 - offering Rider corpses (trunk only)
The report that killing a Rider on an altar allowed you to sacrifice its corpse was a wizard mode-only phenomenon in 3.4.3 (because you needed to use an altar at some location other than the Astral Plane, hence also needed to use ^G to get the Rider there), so not really a bug. But a post-3.4.3 change has made it possible to offer corpses from the floor on the astral level, unintentionally making it possible to sacrifice Rider corpses. This makdes #offer check specifically for them and trigger their revival if the attempt is made, same as done by pickup.
This commit is contained in:
@@ -1683,6 +1683,7 @@ E int FDECL(collect_obj_classes,
|
|||||||
E int FDECL(collect_obj_classes,
|
E int FDECL(collect_obj_classes,
|
||||||
(char *,struct obj *,BOOLEAN_P,BOOLEAN_P,boolean FDECL((*),(OBJ_P)), int *));
|
(char *,struct obj *,BOOLEAN_P,BOOLEAN_P,boolean FDECL((*),(OBJ_P)), int *));
|
||||||
#endif
|
#endif
|
||||||
|
E boolean FDECL(rider_corpse_revival, (struct obj *,BOOLEAN_P));
|
||||||
E void FDECL(add_valid_menu_class, (int));
|
E void FDECL(add_valid_menu_class, (int));
|
||||||
E boolean FDECL(allow_all, (struct obj *));
|
E boolean FDECL(allow_all, (struct obj *));
|
||||||
E boolean FDECL(allow_category, (struct obj *));
|
E boolean FDECL(allow_category, (struct obj *));
|
||||||
|
|||||||
+19
-9
@@ -1,4 +1,4 @@
|
|||||||
/* SCCS Id: @(#)pickup.c 3.5 2008/03/19 */
|
/* SCCS Id: @(#)pickup.c 3.5 2008/10/09 */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
|
|
||||||
@@ -289,6 +289,22 @@ boolean remotely;
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* attempting to manipulate a Rider's corpse triggers its revival */
|
||||||
|
boolean
|
||||||
|
rider_corpse_revival(obj, remotely)
|
||||||
|
struct obj *obj;
|
||||||
|
boolean remotely;
|
||||||
|
{
|
||||||
|
if (!obj || obj->otyp != CORPSE || !is_rider(&mons[obj->corpsenm]))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
pline("At your %s, the corpse suddenly moves...",
|
||||||
|
remotely ? "attempted acquisition" : "touch");
|
||||||
|
(void)revive_corpse(obj);
|
||||||
|
exercise(A_WIS, FALSE);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
/* look at the objects at our location, unless there are too many of them */
|
/* look at the objects at our location, unless there are too many of them */
|
||||||
STATIC_OVL void
|
STATIC_OVL void
|
||||||
check_here(picked_some)
|
check_here(picked_some)
|
||||||
@@ -1353,15 +1369,9 @@ boolean telekinesis; /* not picking it up directly by hand */
|
|||||||
return 1;
|
return 1;
|
||||||
#endif
|
#endif
|
||||||
} else if (obj->otyp == CORPSE) {
|
} else if (obj->otyp == CORPSE) {
|
||||||
if (fatal_corpse_mistake(obj, telekinesis)) {
|
if (fatal_corpse_mistake(obj, telekinesis) ||
|
||||||
|
rider_corpse_revival(obj, telekinesis))
|
||||||
return -1;
|
return -1;
|
||||||
} else if (is_rider(&mons[obj->corpsenm])) {
|
|
||||||
pline("At your %s, the corpse suddenly moves...",
|
|
||||||
telekinesis ? "attempted acquisition" : "touch");
|
|
||||||
(void) revive_corpse(obj);
|
|
||||||
exercise(A_WIS, FALSE);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
} else if (obj->otyp == SCR_SCARE_MONSTER) {
|
} else if (obj->otyp == SCR_SCARE_MONSTER) {
|
||||||
if (obj->blessed) obj->blessed = 0;
|
if (obj->blessed) obj->blessed = 0;
|
||||||
else if (!obj->spe && !obj->cursed) obj->spe = 1;
|
else if (!obj->spe && !obj->cursed) obj->spe = 1;
|
||||||
|
|||||||
+2
-1
@@ -1,4 +1,4 @@
|
|||||||
/* SCCS Id: @(#)pray.c 3.5 2008/01/21 */
|
/* SCCS Id: @(#)pray.c 3.5 2008/10/09 */
|
||||||
/* 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. */
|
||||||
|
|
||||||
@@ -1206,6 +1206,7 @@ dosacrifice()
|
|||||||
|
|
||||||
/* you're handling this corpse, even if it was killed upon the altar */
|
/* you're handling this corpse, even if it was killed upon the altar */
|
||||||
feel_cockatrice(otmp, TRUE);
|
feel_cockatrice(otmp, TRUE);
|
||||||
|
if (rider_corpse_revival(otmp, FALSE)) return 1;
|
||||||
|
|
||||||
if (otmp->corpsenm == PM_ACID_BLOB
|
if (otmp->corpsenm == PM_ACID_BLOB
|
||||||
|| (monstermoves <= peek_at_iced_corpse_age(otmp) + 50)) {
|
|| (monstermoves <= peek_at_iced_corpse_age(otmp) + 50)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user