diff options
| author | historia <[not public]> | 2026-07-13 15:07:28 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-07-13 15:07:28 -0400 |
| commit | 93a412aed2b11406399504c81d6d19ed1341908a (patch) | |
| tree | d99f0c283e6684d266676438fbec4e550bf9c774 /internal/validate/checks.go | |
| parent | fcc9c0a83df82093efd3a85e8e0dc0768653ea87 (diff) | |
| download | thehouseoficarus-93a412aed2b11406399504c81d6d19ed1341908a.tar.gz | |
feat(admin): hide irrelevant combat stats for task mobs, show relevant combat stats for hazards
Diffstat (limited to 'internal/validate/checks.go')
| -rw-r--r-- | internal/validate/checks.go | 16 |
1 files changed, 10 insertions, 6 deletions
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{ |
