]> granicus.if.org Git - nethack/commitdiff
Destroy water walking boots on lava first.
authorSean Hunt <scshunt@csclub.uwaterloo.ca>
Thu, 19 Feb 2015 04:05:37 +0000 (23:05 -0500)
committerSean Hunt <scshunt@csclub.uwaterloo.ca>
Thu, 19 Feb 2015 04:05:37 +0000 (23:05 -0500)
This avoids a player being left standing on lava if their boots are burned up and
they survive the damage.

This change is originally due to Steve Melenchuk, fixed up by Derrick Sund.

src/trap.c

index e0e4b38af0c564cf9c4de6781811f5a11dcf0f5c..9522fe0fd81eb3c4fe253e1db4e647467798c1c0 100644 (file)
@@ -4708,14 +4708,24 @@ lava_effects()
                    !obj_resists(obj, 0, 0))    /* for invocation items */
                obj->in_use = TRUE;
 
+    /* Check whether we should burn away boots *first* so we know whether to
+     * make the player sink into the lava. Assumption: water walking only comes
+     * from boots. */
+    if (Wwalking && uarmf && is_organic(uarmf) && !uarmf->oerodeproof) {
+        obj = uarmf;
+        pline("Your %s into flame!", aobjnam(obj, "burst"));
+        setequip(os_armf, NULL, em_silent);
+        useupall(obj);
+    }
+
     if (!Fire_resistance) {
-       if(Wwalking) {
+        if(Wwalking) {
            pline_The("lava here burns you!");
            if (usurvive) {
                losehp(dmg, lava_killer, KILLED_BY);    /* lava damage */
                goto burn_stuff;
            }
-       } else
+        } else
            You("fall into the lava!");
 
        usurvive = Lifesaved || discover;