Only output candelabrum tip if candles are in inventory

This commit is contained in:
Patric Mueller
2020-01-04 22:54:14 +01:00
parent 40d6dbaa96
commit 18b46449f0
2 changed files with 16 additions and 2 deletions
+1
View File
@@ -77,6 +77,7 @@ NetHack Community Patches (or Variation) Included
------------------------------------------------- -------------------------------------------------
hallucinatory trap names from github pull request #174 hallucinatory trap names from github pull request #174
autounlock feature originally from unnethack in github pull request #228 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 Code Cleanup and Reorganization
+14 -1
View File
@@ -1138,7 +1138,20 @@ register struct obj *obj;
} }
if (obj->spe <= 0) { if (obj->spe <= 0) {
pline("This %s has no %s.", xname(obj), s); 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; return;
} }
if (Underwater) { if (Underwater) {