Only output candelabrum tip if candles are in inventory
This commit is contained in:
@@ -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
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user