Fix a crash-causing null pointer dereference.

(Thanks to Yitzhak)
This commit is contained in:
nethack.allison
2002-01-24 18:21:24 +00:00
parent 654a297052
commit eed0831f28

View File

@@ -545,7 +545,8 @@ boolean test_only;
} else if (tunnels(youmonst.data) && !needspick(youmonst.data)) {
/* Eat the rock. */
if (!test_only && still_chewing(x,y)) return FALSE;
} else if (flags.autodig && !flags.run && !flags.nopick && (uwep->otyp == PICK_AXE || uwep->otyp == DWARVISH_MATTOCK)) {
} else if (flags.autodig && !flags.run && !flags.nopick &&
(uwep && (uwep->otyp == PICK_AXE || uwep->otyp == DWARVISH_MATTOCK))) {
/* MRKR: Automatic digging when wielding the appropriate tool */
if (!test_only) {
use_pick_axe2(uwep);