Skip to content

Commit 510f13d

Browse files
committed
Fix: wearing gloves with elemental object properties and elemental damage.
Wearing gloves/gauntlets that have fire/cold/shock resistance can sometimes cause elemental damage to monsters being attacked if you attack them bare-handed. This damage was being applied to thrown objects as well (technically still attacking without a wielded weapon). Prevent that from occurring. Fix a similar case with the Gauntlets of Purity and extra damage.
1 parent 5bf831c commit 510f13d

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

doc/evilhack-changelog.md

+2
Original file line numberDiff line numberDiff line change
@@ -4003,4 +4003,6 @@ The following changes to date are:
40034003
- Adjust the artifact Keolewa shock damage so it's better than a club
40044004
with the lightning object property
40054005
- Fix: Harbinger was not protecting worn armor from acid damage
4006+
- Fix: wearing gloves with elemental object properties and elemental
4007+
damage
40064008

src/uhitm.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -1821,7 +1821,7 @@ int dieroll;
18211821

18221822
/* potential for gloves with an object property
18231823
to do additional damage */
1824-
if (!destroyed && !rn2(3) && !uwep && uarmg
1824+
if (!destroyed && !rn2(3) && hand_to_hand && !uwep && uarmg
18251825
&& (uarmg->oprops & (ITEM_FIRE | ITEM_FROST | ITEM_SHOCK))) {
18261826
artifact_hit(&youmonst, mon, uarmg, &tmp, dieroll);
18271827
hittxt = TRUE;
@@ -1861,7 +1861,8 @@ int dieroll;
18611861
/* if lawful, trained in martial arts, and wearing the
18621862
Gauntlets of Purity, get a damage bonus when attacking
18631863
unarmed */
1864-
if (!destroyed && actually_unarmed && P_SKILL(P_MARTIAL_ARTS)
1864+
if (!destroyed && hand_to_hand && actually_unarmed
1865+
&& P_SKILL(P_MARTIAL_ARTS)
18651866
&& u.ualign.type == A_LAWFUL && martial_bonus()
18661867
&& uarmg && uarmg->oartifact == ART_GAUNTLETS_OF_PURITY)
18671868
tmp += rnd(4) + 2;

0 commit comments

Comments
 (0)