From d703539847bd51040cec8466288871673872658e Mon Sep 17 00:00:00 2001 From: nhmall Date: Sat, 22 Apr 2023 11:13:53 -0400 Subject: [PATCH] define WT_ macros in a header file A recently added #undef WT_ELF caused a onefile build to break. trap.c: In function 'trapeffect_landmine': trap.c:2346:41: error: 'WT_ELF' undeclared (first use in this function); did you mean 'PM_ELF'? trap.c:2346:41: note: each undeclared identifier is reported only once for each function it appears in --- include/monsters.h | 8 -------- include/permonst.h | 5 +++-- src/monst.c | 5 ----- 3 files changed, 3 insertions(+), 15 deletions(-) diff --git a/include/monsters.h b/include/monsters.h index 5bfe2377c..6e3a2093e 100644 --- a/include/monsters.h +++ b/include/monsters.h @@ -3,14 +3,6 @@ /*-Copyright (c) Michael Allison, 2006. */ /* NetHack may be freely redistributed. See license for details. */ -#ifndef WT_ELF -#define WT_ELF 800 -#endif - -#ifndef WT_DRAGON -#define WT_DRAGON 4500 -#endif - #if defined(MONS_ENUM) #define MON(nam, sym, lvl, gen, atk, siz, mr1, mr2, flg1, flg2, flg3, d, \ col, bn) PM_##bn diff --git a/include/permonst.h b/include/permonst.h index 753749141..cbb507e64 100644 --- a/include/permonst.h +++ b/include/permonst.h @@ -28,10 +28,11 @@ struct attack { #define NATTK 6 -/* Weight of a human body +/* Weight of human body, elf, dragon */ - #define WT_HUMAN 1450 +#define WT_ELF 800 +#define WT_DRAGON 4500 #ifndef ALIGN_H #include "align.h" diff --git a/src/monst.c b/src/monst.c index 04c80bd8b..1625d2a60 100644 --- a/src/monst.c +++ b/src/monst.c @@ -25,9 +25,6 @@ 0, 0, 0, 0 \ } -#define WT_ELF 800 -#define WT_DRAGON 4500 - #define MON(nam, sym, lvl, gen, atk, siz, mr1, mr2, \ flg1, flg2, flg3, d, col, bn) \ { \ @@ -89,8 +86,6 @@ const struct attack c_sa_no[NATTK] = SEDUCTION_ATTACKS_NO; #undef HI_LORD #endif #undef NO_ATTK -#undef WT_ELF -#undef WT_DRAGON #undef MON #undef MON3 #undef LVL