PR #1125 - more disturbing buried zombies

Pull request from entrez:  hero walking over a zombie's burial site
will only disturb it if meeting a minimum weight threshold.

Update several weight macros to be 'unsigned', matching mons[].cwt.
[I'm not sure about this one.  'unsigned short' promotes to 'signed
int' these days on most platforms.]

Closes #1125
This commit is contained in:
PatR
2023-11-10 10:33:11 -08:00
2 changed files with 6 additions and 4 deletions

View File

@@ -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"

View File

@@ -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