Merge branch 'NetHack-3.6.2'
This commit is contained in:
54
src/objnam.c
54
src/objnam.c
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 objnam.c $NHDT-Date: 1546687293 2019/01/05 11:21:33 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.232 $ */
|
||||
/* NetHack 3.6 objnam.c $NHDT-Date: 1547025168 2019/01/09 09:12:48 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.233 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Robert Patrick Rankin, 2011. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -700,7 +700,7 @@ unsigned cxn_flags; /* bitmask of CXN_xxx values */
|
||||
|
||||
if (has_oname(obj) && dknown) {
|
||||
Strcat(buf, " named ");
|
||||
nameit:
|
||||
nameit:
|
||||
Strcat(buf, ONAME(obj));
|
||||
}
|
||||
|
||||
@@ -734,7 +734,7 @@ struct obj *obj;
|
||||
|
||||
/* caveat: this makes a lot of assumptions about which fields
|
||||
are required in order for xname() to yield a sensible result */
|
||||
bareobj = g.zeroobj;
|
||||
bareobj = cg.zeroobj;
|
||||
bareobj.otyp = otyp;
|
||||
bareobj.oclass = obj->oclass;
|
||||
bareobj.dknown = obj->dknown;
|
||||
@@ -1078,7 +1078,7 @@ unsigned doname_flags;
|
||||
goto charges;
|
||||
break;
|
||||
case WAND_CLASS:
|
||||
charges:
|
||||
charges:
|
||||
if (known)
|
||||
Sprintf(eos(bp), " (%d:%d)", (int) obj->recharged, obj->spe);
|
||||
break;
|
||||
@@ -1087,7 +1087,7 @@ unsigned doname_flags;
|
||||
Strcat(bp, " (lit)");
|
||||
break;
|
||||
case RING_CLASS:
|
||||
ring:
|
||||
ring:
|
||||
if (obj->owornmask & W_RINGR)
|
||||
Strcat(bp, " (on right ");
|
||||
if (obj->owornmask & W_RINGL)
|
||||
@@ -2030,7 +2030,7 @@ register const char *verb;
|
||||
return strcpy(buf, verb);
|
||||
}
|
||||
|
||||
sing:
|
||||
sing:
|
||||
Strcpy(buf, verb);
|
||||
len = (int) strlen(buf);
|
||||
bspot = buf + len - 1;
|
||||
@@ -2374,7 +2374,7 @@ const char *oldstr;
|
||||
/* Default: append an 's' */
|
||||
Strcasecpy(spot + 1, "s");
|
||||
|
||||
bottom:
|
||||
bottom:
|
||||
if (excess)
|
||||
Strcat(str, excess);
|
||||
return str;
|
||||
@@ -2474,7 +2474,7 @@ const char *oldstr;
|
||||
|| (p - 4 == bp && !strcmpi(p - 4, "lens"))) {
|
||||
goto bottom;
|
||||
}
|
||||
mins:
|
||||
mins:
|
||||
*(p - 1) = '\0'; /* drop s */
|
||||
|
||||
} else { /* input doesn't end in 's' */
|
||||
@@ -2498,7 +2498,7 @@ const char *oldstr;
|
||||
/* here we cannot find the plural suffix */
|
||||
}
|
||||
|
||||
bottom:
|
||||
bottom:
|
||||
/* if we stripped off a suffix (" of bar" from "foo of bar"),
|
||||
put it back now [strcat() isn't actually 100% safe here...] */
|
||||
if (excess)
|
||||
@@ -2813,7 +2813,7 @@ char oclass;
|
||||
* Return something wished for. Specifying a null pointer for
|
||||
* the user request string results in a random object. Otherwise,
|
||||
* if asking explicitly for "nothing" (or "nil") return no_wish;
|
||||
* if not an object return &g.zeroobj; if an error (no matching object),
|
||||
* if not an object return &cg.zeroobj; if an error (no matching object),
|
||||
* return null.
|
||||
*/
|
||||
struct obj *
|
||||
@@ -3371,7 +3371,7 @@ struct obj *no_wish;
|
||||
}
|
||||
}
|
||||
|
||||
retry:
|
||||
retry:
|
||||
/* "grey stone" check must be before general "stone" */
|
||||
for (i = 0; i < SIZE(o_ranges); i++)
|
||||
if (!strcmpi(bp, o_ranges[i].name)) {
|
||||
@@ -3420,7 +3420,7 @@ retry:
|
||||
actualn = bp;
|
||||
if (!dn)
|
||||
dn = actualn; /* ex. "skull cap" */
|
||||
srch:
|
||||
srch:
|
||||
/* check real names of gems first */
|
||||
if (!oclass && actualn) {
|
||||
for (i = g.bases[GEM_CLASS]; i <= LAST_GEM; i++) {
|
||||
@@ -3556,7 +3556,7 @@ srch:
|
||||
* trap objects like beartraps.
|
||||
* Disallow such topology tweaks for WIZKIT startup wishes.
|
||||
*/
|
||||
wiztrap:
|
||||
wiztrap:
|
||||
if (wizard && !g.program_state.wizkit_wishing) {
|
||||
struct rm *lev;
|
||||
int trap, x = u.ux, y = u.uy;
|
||||
@@ -3578,7 +3578,7 @@ wiztrap:
|
||||
(trap != MAGIC_PORTAL) ? "" : " to nowhere");
|
||||
} else
|
||||
pline("Creation of %s failed.", an(tname));
|
||||
return &g.zeroobj;
|
||||
return (struct obj *) &cg.zeroobj;
|
||||
}
|
||||
|
||||
/* furniture and terrain */
|
||||
@@ -3591,20 +3591,20 @@ wiztrap:
|
||||
lev->blessedftn = 1;
|
||||
pline("A %sfountain.", lev->blessedftn ? "magic " : "");
|
||||
newsym(x, y);
|
||||
return &g.zeroobj;
|
||||
return (struct obj *) &cg.zeroobj;
|
||||
}
|
||||
if (!BSTRCMPI(bp, p - 6, "throne")) {
|
||||
lev->typ = THRONE;
|
||||
pline("A throne.");
|
||||
newsym(x, y);
|
||||
return &g.zeroobj;
|
||||
return (struct obj *) &cg.zeroobj;
|
||||
}
|
||||
if (!BSTRCMPI(bp, p - 4, "sink")) {
|
||||
lev->typ = SINK;
|
||||
g.level.flags.nsinks++;
|
||||
pline("A sink.");
|
||||
newsym(x, y);
|
||||
return &g.zeroobj;
|
||||
return (struct obj *) &cg.zeroobj;
|
||||
}
|
||||
/* ("water" matches "potion of water" rather than terrain) */
|
||||
if (!BSTRCMPI(bp, p - 4, "pool") || !BSTRCMPI(bp, p - 4, "moat")) {
|
||||
@@ -3614,7 +3614,7 @@ wiztrap:
|
||||
/* Must manually make kelp! */
|
||||
water_damage_chain(g.level.objects[x][y], TRUE);
|
||||
newsym(x, y);
|
||||
return &g.zeroobj;
|
||||
return (struct obj *) &cg.zeroobj;
|
||||
}
|
||||
if (!BSTRCMPI(bp, p - 4, "lava")) { /* also matches "molten lava" */
|
||||
lev->typ = LAVAPOOL;
|
||||
@@ -3623,7 +3623,7 @@ wiztrap:
|
||||
if (!(Levitation || Flying))
|
||||
(void) lava_effects();
|
||||
newsym(x, y);
|
||||
return &g.zeroobj;
|
||||
return (struct obj *) &cg.zeroobj;
|
||||
}
|
||||
|
||||
if (!BSTRCMPI(bp, p - 5, "altar")) {
|
||||
@@ -3643,7 +3643,7 @@ wiztrap:
|
||||
lev->altarmask = Align2amask(al);
|
||||
pline("%s altar.", An(align_str(al)));
|
||||
newsym(x, y);
|
||||
return &g.zeroobj;
|
||||
return (struct obj *) &cg.zeroobj;
|
||||
}
|
||||
|
||||
if (!BSTRCMPI(bp, p - 5, "grave")
|
||||
@@ -3652,7 +3652,7 @@ wiztrap:
|
||||
pline("%s.", IS_GRAVE(lev->typ) ? "A grave"
|
||||
: "Can't place a grave here");
|
||||
newsym(x, y);
|
||||
return &g.zeroobj;
|
||||
return (struct obj *) &cg.zeroobj;
|
||||
}
|
||||
|
||||
if (!BSTRCMPI(bp, p - 4, "tree")) {
|
||||
@@ -3660,14 +3660,14 @@ wiztrap:
|
||||
pline("A tree.");
|
||||
newsym(x, y);
|
||||
block_point(x, y);
|
||||
return &g.zeroobj;
|
||||
return (struct obj *) &cg.zeroobj;
|
||||
}
|
||||
|
||||
if (!BSTRCMPI(bp, p - 4, "bars")) {
|
||||
lev->typ = IRONBARS;
|
||||
pline("Iron bars.");
|
||||
newsym(x, y);
|
||||
return &g.zeroobj;
|
||||
return (struct obj *) &cg.zeroobj;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3683,10 +3683,10 @@ wiztrap:
|
||||
|
||||
if (!oclass)
|
||||
return ((struct obj *) 0);
|
||||
any:
|
||||
any:
|
||||
if (!oclass)
|
||||
oclass = wrpsym[rn2((int) sizeof(wrpsym))];
|
||||
typfnd:
|
||||
oclass = wrpsym[rn2((int) sizeof wrpsym)];
|
||||
typfnd:
|
||||
if (typ)
|
||||
oclass = objects[typ].oc_class;
|
||||
|
||||
@@ -3976,7 +3976,7 @@ typfnd:
|
||||
|| (otmp->oartifact && rn2(nartifact_exist()) > 1)) && !wizard) {
|
||||
artifact_exists(otmp, safe_oname(otmp), FALSE);
|
||||
obfree(otmp, (struct obj *) 0);
|
||||
otmp = &g.zeroobj;
|
||||
otmp = (struct obj *) &cg.zeroobj;
|
||||
pline("For a moment, you feel %s in your %s, but it disappears!",
|
||||
something, makeplural(body_part(HAND)));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user