From 93a412aed2b11406399504c81d6d19ed1341908a Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Mon, 13 Jul 2026 15:07:28 -0400 Subject: feat(admin): hide irrelevant combat stats for task mobs, show relevant combat stats for hazards --- internal/validate/checks.go | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'internal/validate') diff --git a/internal/validate/checks.go b/internal/validate/checks.go index bbcb820..7ac6fa1 100644 --- a/internal/validate/checks.go +++ b/internal/validate/checks.go @@ -508,12 +508,16 @@ func validateHazards(s Source) []Issue { }) continue } - if def.AttackType != "" && !combat.IsValidAttackType(def.AttackType) { - issues = append(issues, Issue{ - Level: "ERROR", - Type: "reference", - Message: fmt.Sprintf("Hazard %q: invalid attack_type %q (must be stab/slash/crush/ranged/science)", id, def.AttackType), - }) + if def.Combat != nil { + for _, t := range def.Combat.AttackTypes { + if t != "" && !combat.IsValidAttackType(t) { + issues = append(issues, Issue{ + Level: "ERROR", + Type: "reference", + Message: fmt.Sprintf("Hazard %q: invalid attack_type %q (must be stab/slash/crush/ranged/science)", id, t), + }) + } + } } if def.RequiredItem != "" && !itemIDs[def.RequiredItem] { issues = append(issues, Issue{ -- cgit v1.2.3