Merge branch 'NetHack-3.6'

This commit is contained in:
nhmall
2019-05-22 00:48:39 -04:00
5 changed files with 33 additions and 22 deletions

View File

@@ -12,6 +12,7 @@ ad aerarium
Owlbreath
Galadriel
Kilroy was here
Frodo lives
# Journey to the Center of the Earth
A.S. ->
@@ -86,3 +87,6 @@ Warning, Exploding runes!
# "Whispers Underground" Ben Aaronovitch
If you can read these words then you are not only a nerd but probably dead.
# Portal
The cake is a lie

View File

@@ -50,6 +50,7 @@ classify sources as released, beta, or work-in-progress via NH_DEVEL_STATUS
NetHack Community Patches (or Variation) Included
-------------------------------------------------
add a couple of engraving suggestions in pull request #79
Code Cleanup and Reorganization

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 extern.h $NHDT-Date: 1557088399 2019/05/05 20:33:19 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.703 $ */
/* NetHack 3.6 extern.h $NHDT-Date: 1558485640 2019/05/22 00:40:40 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.706 $ */
/* Copyright (c) Steve Creps, 1988. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1668,6 +1668,7 @@ E void NDECL(objects_globals_init);
E char *FDECL(obj_typename, (int));
E char *FDECL(simple_typename, (int));
E char *FDECL(safe_typename, (int));
E boolean FDECL(obj_is_pname, (struct obj *));
E char *FDECL(distant_name, (struct obj *, char *(*)(OBJ_P)));
E char *FDECL(fruitname, (BOOLEAN_P));

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 ball.c $NHDT-Date: 1557088406 2019/05/05 20:33:26 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.36 $ */
/* NetHack 3.6 ball.c $NHDT-Date: 1558485648 2019/05/22 00:40:48 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.37 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) David Cohrs, 2006. */
/* NetHack may be freely redistributed. See license for details. */
@@ -850,7 +850,6 @@ void
bc_sanity_check()
{
int otyp;
unsigned save_nameknown;
const char *onam;
if (Punished && (!uball || !uchain)) {
@@ -872,15 +871,7 @@ bc_sanity_check()
|| (uball->owornmask & W_BALL) == 0L
|| (uball->owornmask & ~(W_BALL | W_WEAPON)) != 0L)) {
otyp = uball->otyp;
if (otyp < STRANGE_OBJECT || otyp >= NUM_OBJECTS
|| !OBJ_NAME(objects[otyp])) {
onam = "glorkum";
} else {
save_nameknown = objects[otyp].oc_name_known;
objects[otyp].oc_name_known = 1;
onam = simple_typename(otyp);
objects[otyp].oc_name_known = save_nameknown;
}
onam = safe_typename(otyp);
impossible("uball: type %d (%s), where %d, wornmask=0x%08lx",
otyp, onam, uball->where, uball->owornmask);
}
@@ -892,15 +883,7 @@ bc_sanity_check()
|| (uchain->owornmask & W_CHAIN) == 0L
|| (uchain->owornmask & ~W_CHAIN) != 0L)) {
otyp = uchain->otyp;
if (otyp < STRANGE_OBJECT || otyp >= NUM_OBJECTS
|| !OBJ_NAME(objects[otyp])) {
onam = "glorkum";
} else {
save_nameknown = objects[otyp].oc_name_known;
objects[otyp].oc_name_known = 1;
onam = simple_typename(otyp);
objects[otyp].oc_name_known = save_nameknown;
}
onam = safe_typename(otyp);
impossible("uchain: type %d (%s), where %d, wornmask=0x%08lx",
otyp, onam, uchain->where, uchain->owornmask);
}

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 objnam.c $NHDT-Date: 1558125504 2019/05/17 20:38:24 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.239 $ */
/* NetHack 3.6 objnam.c $NHDT-Date: 1558485650 2019/05/22 00:40:50 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.241 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2011. */
/* NetHack may be freely redistributed. See license for details. */
@@ -199,6 +199,28 @@ int otyp;
return bufp;
}
/* typename for debugging feedback where data involved might be suspect */
char *
safe_typename(otyp)
int otyp;
{
unsigned save_nameknown;
char *res = 0;
if (otyp < STRANGE_OBJECT || otyp >= NUM_OBJECTS
|| !OBJ_NAME(objects[otyp])) {
res = nextobuf();
Sprintf(res, "glorkum[%d]", otyp);
} else {
/* force it to be treated as fully discovered */
save_nameknown = objects[otyp].oc_name_known;
objects[otyp].oc_name_known = 1;
res = simple_typename(otyp);
objects[otyp].oc_name_known = save_nameknown;
}
return res;
}
boolean
obj_is_pname(obj)
struct obj *obj;