refine setworn()'s impossible()
If setworn() issues "Setworn: mask = 1234.", format the number in hexadecimal so that the high bits are easier to decipher. Noticed when experimenting with ball and chain where the decimal values of their worn-masks are beyond the range of powers of 2 I recognize.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.7 worn.c $NHDT-Date: 1646260985 2022/03/02 22:43:05 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.81 $ */
|
||||
/* NetHack 3.7 worn.c $NHDT-Date: 1649529637 2022/04/09 18:40:37 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.82 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Robert Patrick Rankin, 2013. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -58,7 +58,7 @@ setworn(struct obj *obj, long mask)
|
||||
if (wp->w_mask & mask) {
|
||||
oobj = *(wp->w_obj);
|
||||
if (oobj && !(oobj->owornmask & wp->w_mask))
|
||||
impossible("Setworn: mask = %ld.", wp->w_mask);
|
||||
impossible("Setworn: mask=0x%08lx.", wp->w_mask);
|
||||
if (oobj) {
|
||||
if (u.twoweap && (oobj->owornmask & (W_WEP | W_SWAPWEP)))
|
||||
set_twoweap(FALSE); /* u.twoweap = FALSE */
|
||||
|
||||
Reference in New Issue
Block a user