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
+4
View File
@@ -12,6 +12,7 @@ ad aerarium
Owlbreath Owlbreath
Galadriel Galadriel
Kilroy was here Kilroy was here
Frodo lives
# Journey to the Center of the Earth # Journey to the Center of the Earth
A.S. -> A.S. ->
@@ -86,3 +87,6 @@ Warning, Exploding runes!
# "Whispers Underground" Ben Aaronovitch # "Whispers Underground" Ben Aaronovitch
If you can read these words then you are not only a nerd but probably dead. If you can read these words then you are not only a nerd but probably dead.
# Portal
The cake is a lie
+1
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 NetHack Community Patches (or Variation) Included
------------------------------------------------- -------------------------------------------------
add a couple of engraving suggestions in pull request #79
Code Cleanup and Reorganization Code Cleanup and Reorganization
+2 -1
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. */ /* Copyright (c) Steve Creps, 1988. */
/* NetHack may be freely redistributed. See license for details. */ /* 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(obj_typename, (int));
E char *FDECL(simple_typename, (int)); E char *FDECL(simple_typename, (int));
E char *FDECL(safe_typename, (int));
E boolean FDECL(obj_is_pname, (struct obj *)); E boolean FDECL(obj_is_pname, (struct obj *));
E char *FDECL(distant_name, (struct obj *, char *(*)(OBJ_P))); E char *FDECL(distant_name, (struct obj *, char *(*)(OBJ_P)));
E char *FDECL(fruitname, (BOOLEAN_P)); E char *FDECL(fruitname, (BOOLEAN_P));
+3 -20
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) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) David Cohrs, 2006. */ /*-Copyright (c) David Cohrs, 2006. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -850,7 +850,6 @@ void
bc_sanity_check() bc_sanity_check()
{ {
int otyp; int otyp;
unsigned save_nameknown;
const char *onam; const char *onam;
if (Punished && (!uball || !uchain)) { if (Punished && (!uball || !uchain)) {
@@ -872,15 +871,7 @@ bc_sanity_check()
|| (uball->owornmask & W_BALL) == 0L || (uball->owornmask & W_BALL) == 0L
|| (uball->owornmask & ~(W_BALL | W_WEAPON)) != 0L)) { || (uball->owornmask & ~(W_BALL | W_WEAPON)) != 0L)) {
otyp = uball->otyp; otyp = uball->otyp;
if (otyp < STRANGE_OBJECT || otyp >= NUM_OBJECTS onam = safe_typename(otyp);
|| !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;
}
impossible("uball: type %d (%s), where %d, wornmask=0x%08lx", impossible("uball: type %d (%s), where %d, wornmask=0x%08lx",
otyp, onam, uball->where, uball->owornmask); otyp, onam, uball->where, uball->owornmask);
} }
@@ -892,15 +883,7 @@ bc_sanity_check()
|| (uchain->owornmask & W_CHAIN) == 0L || (uchain->owornmask & W_CHAIN) == 0L
|| (uchain->owornmask & ~W_CHAIN) != 0L)) { || (uchain->owornmask & ~W_CHAIN) != 0L)) {
otyp = uchain->otyp; otyp = uchain->otyp;
if (otyp < STRANGE_OBJECT || otyp >= NUM_OBJECTS onam = safe_typename(otyp);
|| !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;
}
impossible("uchain: type %d (%s), where %d, wornmask=0x%08lx", impossible("uchain: type %d (%s), where %d, wornmask=0x%08lx",
otyp, onam, uchain->where, uchain->owornmask); otyp, onam, uchain->where, uchain->owornmask);
} }
+23 -1
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) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2011. */ /*-Copyright (c) Robert Patrick Rankin, 2011. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -199,6 +199,28 @@ int otyp;
return bufp; 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 boolean
obj_is_pname(obj) obj_is_pname(obj)
struct obj *obj; struct obj *obj;