From daadb53ec0857ce86d1e404de7ae3f7587eb1e70 Mon Sep 17 00:00:00 2001 From: PatR Date: Sat, 9 Apr 2022 11:40:47 -0700 Subject: [PATCH] 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. --- src/worn.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/worn.c b/src/worn.c index 92299d3ca..1040715e4 100644 --- a/src/worn.c +++ b/src/worn.c @@ -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 */