From ed406dafe7dbf0d95f5806f01fe1cc075e4fbbc0 Mon Sep 17 00:00:00 2001 From: nhmall Date: Mon, 17 Mar 2025 07:38:37 -0400 Subject: [PATCH] follow-up: store square of dist in arwep table Also includes some additional unrelated #undef's since one was being added. --- src/monmove.c | 2 +- src/weapon.c | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/monmove.c b/src/monmove.c index 17c7d7f83..c16588955 100644 --- a/src/monmove.c +++ b/src/monmove.c @@ -1210,7 +1210,7 @@ m_balks_at_approaching(int oldappr, struct monst *mtmp, int *pdistmin, if (pdistmin) *pdistmin = 2 * 2; if (pdistmax) - *pdistmax = arw->range * arw->range; + *pdistmax = arw->range; return -2; } diff --git a/src/weapon.c b/src/weapon.c index af6beac22..12e5b5d99 100644 --- a/src/weapon.c +++ b/src/weapon.c @@ -507,10 +507,11 @@ static NEARDATA const int pwep[] = { HALBERD, BARDICHE, SPETUM, BEC_DE_CORBIN, FAUCHARD, PARTISAN, LANCE }; +#define AKLYS_LIM (BOLT_LIM / 2) /* throw-and-return weapons */ static NEARDATA const struct throw_and_return_weapon arwep[] = { /* { BOOMERANG, 5, 0 }, */ - { AKLYS, (BOLT_LIM / 2), 1 }, + { AKLYS, AKLYS_LIM * AKLYS_LIM, 1 }, }; const struct throw_and_return_weapon * @@ -1779,4 +1780,19 @@ setmnotwielded(struct monst *mon, struct obj *obj) obj->owornmask &= ~W_WEP; } +#undef PN_BARE_HANDED +#undef PN_RIDING +#undef PN_POLEARMS +#undef PN_SABER +#undef PN_HAMMER +#undef PN_WHIP +#undef PN_ATTACK_SPELL +#undef PN_HEALING_SPELL +#undef PN_DIVINATION_SPELL +#undef PN_ENCHANTMENT_SPELL +#undef PN_CLERIC_SPELL +#undef PN_ESCAPE_SPELL +#undef PN_MATTER_SPELL +#undef AKLYS_LIM + /*weapon.c*/