Skip to content

Commit 91630d8

Browse files
authored
Fix NWNX_TWEAKS_SNEAK_ATTACK_IGNORE_CRIT_IMMUNITY to work with up to 8 classes (#1853)
1 parent ab5ac90 commit 91630d8

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ https://github.com/nwnxee/unified/compare/build8193.37.13...HEAD
3636
- Fixed `NWNX_TWEAKS_SETAREA_CALLS_SETPOSITION` not working with `NWNX_ON_MATERIALCHANGE_*`.
3737
- MaxLevel: Fixed returning an invalid number of known spells in some cases.
3838
- Fixed `NWNX_TWEAKS_RESIST_ENERGY_STACKS_WITH_EPIC_ENERGY_RESISTANCE` not working correctly when the character has more than one resist energy feat.
39+
- Fixed `NWNX_TWEAKS_SNEAK_ATTACK_IGNORE_CRIT_IMMUNITY` only considering 3 classes for determining the level difference of attacker and defender.
3940

4041
## 8193.37.13
4142
https://github.com/nwnxee/unified/compare/build8193.36.10...build8193.37.13

Plugins/Tweaks/SneakAttackCritImmunity.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ static void ResolveSneakAttackHook(CNWSCreature *pThis, CNWSCreature *pTarget)
142142
};
143143
int attackerLevels = 0, defenderLevels = 0;
144144

145-
for (uint8_t i = 0; i < 3; i++)
145+
for (uint8_t i = 0; i < Globals::Rules()->GetRulesetIntEntry(CRULES_HASHEDSTR("MULTICLASS_LIMIT"), 3); i++)
146146
{
147147
uint8_t attackerClass = pThis->m_pStats->GetClass(i);
148148
uint8_t defenderClass = pTarget->m_pStats->GetClass(i);
@@ -255,7 +255,7 @@ static void ResolveDeathAttackHook(CNWSCreature *pThis, CNWSCreature *pTarget)
255255
};
256256
int attackerLevels = 0, defenderLevels = 0;
257257

258-
for (uint8_t i = 0; i < 3; i++)
258+
for (uint8_t i = 0; i < Globals::Rules()->GetRulesetIntEntry(CRULES_HASHEDSTR("MULTICLASS_LIMIT"), 3); i++)
259259
{
260260
uint8_t attackerClass = pThis->m_pStats->GetClass(i);
261261
uint8_t defenderClass = pTarget->m_pStats->GetClass(i);

0 commit comments

Comments
 (0)