From de2c3f033abbf072d64a7aa17dded00ef5dd64c7 Mon Sep 17 00:00:00 2001 From: Michael Meyer Date: Tue, 7 Nov 2023 19:56:52 -0500 Subject: [PATCH 1/2] Make WT_foo defines unsigned These are meant to be 'cwt' values and directly comparable to a particular pm->cwt, which is an unsigned short. My concern here was signed/unsigned comparison warnings like the one fixed in 1538b40, but I'm not sure if this is actually necessary: there is already a comparison between cwt and WT_HUMAN in max_mon_load() which apparently doesn't produce the warning... --- include/permonst.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/permonst.h b/include/permonst.h index cbb507e64..9b71c5f69 100644 --- a/include/permonst.h +++ b/include/permonst.h @@ -30,9 +30,9 @@ struct attack { /* Weight of human body, elf, dragon */ -#define WT_HUMAN 1450 -#define WT_ELF 800 -#define WT_DRAGON 4500 +#define WT_HUMAN 1450U +#define WT_ELF 800U +#define WT_DRAGON 4500U #ifndef ALIGN_H #include "align.h" From 392295d770f00fe53f485cc885cbcee328ed039f Mon Sep 17 00:00:00 2001 From: Michael Meyer Date: Tue, 7 Nov 2023 20:00:56 -0500 Subject: [PATCH 2/2] Require min body weight for step to wake zombies A newt or something probably isn't disturbing anything buried 6 feet below the ground. WT_ELF/2 is the size of a dingo or goblin. --- src/hack.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/hack.c b/src/hack.c index 5e44d2867..9eb1aa791 100644 --- a/src/hack.c +++ b/src/hack.c @@ -2618,7 +2618,9 @@ domove_core(void) nomul(0); } - if (!Levitation && !Flying && !Stealth) + /* your tread on the ground may disturb the slumber of nearby zombies */ + if (!Levitation && !Flying && !Stealth + && gy.youmonst.data->cwt >= (WT_ELF / 2)) disturb_buried_zombies(u.ux, u.uy); if (hides_under(gy.youmonst.data) || gy.youmonst.data->mlet == S_EEL