From 199ed03b8c75157a31b8951a3048b741c4b5f22e Mon Sep 17 00:00:00 2001 From: guiyomu-dev <22749537+guiyomu-dev@users.noreply.github.com> Date: Fri, 14 Nov 2025 21:34:40 +0100 Subject: [PATCH] fix magic numbers --- pkg/nip/rule.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/pkg/nip/rule.go b/pkg/nip/rule.go index 1a8e633..def61e6 100644 --- a/pkg/nip/rule.go +++ b/pkg/nip/rule.go @@ -462,11 +462,12 @@ func getRequiredStatsForRule(line string) []string { } func evaluateClassSkillsSum(it data.Item) int { - // Check all class skills stats (all have base ID 83 with different layers) + // Check all class skills stats totalClassSkills := 0 + maxLayer := 6 // in aliases.go the max layer for class skills is 6 (itemaddassassinskills) - for layer := 0; layer <= 6; layer++ { - if itemStat, found := it.FindStat(stat.ID(83), layer); found && itemStat.Value > 0 { + for layer := 0; layer <= maxLayer; layer++ { + if itemStat, found := it.FindStat(stat.AddClassSkills, layer); found && itemStat.Value > 0 { totalClassSkills += itemStat.Value } } @@ -474,11 +475,12 @@ func evaluateClassSkillsSum(it data.Item) int { return totalClassSkills } func evaluateSkillTabSum(it data.Item) int { - // Check all skill tab stats (all have base ID 188 with different layers) + // Check all skill tab stats totalSkillTabs := 0 + maxLayer := 50 // in aliases.go the max layer for skill tabs is 50 (itemaddmartialartsskilltab) - for layer := 0; layer <= 50; layer++ { - if itemStat, found := it.FindStat(stat.ID(188), layer); found && itemStat.Value > 0 { + for layer := 0; layer <= maxLayer; layer++ { + if itemStat, found := it.FindStat(stat.AddSkillTab, layer); found && itemStat.Value > 0 { totalSkillTabs += itemStat.Value } }