Only output candelabrum tip if candles are in inventory

This commit is contained in:
Patric Mueller
2020-01-04 12:59:09 +01:00
parent 40d6dbaa96
commit 18b46449f0
2 changed files with 16 additions and 2 deletions

View File

@@ -77,6 +77,7 @@ NetHack Community Patches (or Variation) Included
-------------------------------------------------
hallucinatory trap names from github pull request #174
autounlock feature originally from unnethack in github pull request #228
applying a candelabrum with no candles gives a tip (github #265)
Code Cleanup and Reorganization

View File

@@ -1138,7 +1138,20 @@ register struct obj *obj;
}
if (obj->spe <= 0) {
pline("This %s has no %s.", xname(obj), s);
pline("To attach candles, apply them instead of the %s.", xname(obj));
/* only output tip if candles are in inventory */
boolean has_candles = FALSE;
struct obj *otmp = g.invent;
while (!has_candles && otmp) {
has_candles = Is_candle(otmp);
otmp = otmp->nobj;
}
if (has_candles) {
pline("To attach candles, apply them instead of the %s.",
xname(obj));
}
return;
}
if (Underwater) {
@@ -2514,7 +2527,7 @@ struct obj *otmp;
return;
}
ttyp = (otmp->otyp == LAND_MINE) ? LANDMINE : BEAR_TRAP;
if (otmp == g.trapinfo.tobj && u.ux == g.trapinfo.tx
if (otmp == g.trapinfo.tobj && u.ux == g.trapinfo.tx
&& u.uy == g.trapinfo.ty) {
You("resume setting %s%s.", shk_your(buf, otmp),
trapname(ttyp, FALSE));