From 2bbe6b8e912bbc5f4a61a33988fb27aca7bd5eb3 Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Wed, 8 Jul 2026 02:23:59 -0400 Subject: feat: object and mob steal tables can include both tables and items --- internal/validate/checks.go | 50 ++++++++++++++++++++++++++++++++------------- 1 file changed, 36 insertions(+), 14 deletions(-) (limited to 'internal/validate') diff --git a/internal/validate/checks.go b/internal/validate/checks.go index 7cb5914..64b1df4 100644 --- a/internal/validate/checks.go +++ b/internal/validate/checks.go @@ -414,13 +414,25 @@ func validateMobs(s Source) []Issue { } } - if def.Steal != nil && def.Steal.Table != "" && !dropIDs[def.Steal.Table] { - issues = append(issues, Issue{ - Level: "ERROR", - Type: "reference", - Message: fmt.Sprintf("Mob %q: steal table %q does not exist", - id, def.Steal.Table), - }) + if def.Steal != nil { + for _, d := range def.Steal.Drops { + if d.ItemID != "" && !itemIDs[d.ItemID] { + issues = append(issues, Issue{ + Level: "ERROR", + Type: "reference", + Message: fmt.Sprintf("Mob %q: steal drop item %q does not exist", + id, d.ItemID), + }) + } + if d.Table != "" && !dropIDs[d.Table] { + issues = append(issues, Issue{ + Level: "ERROR", + Type: "reference", + Message: fmt.Sprintf("Mob %q: steal drop table %q does not exist", + id, d.Table), + }) + } + } } if def.Combat != nil && def.Combat.FinishingBlow != "" && !itemIDs[def.Combat.FinishingBlow] { @@ -543,13 +555,23 @@ func validateObjects(s Source) []Issue { } if obj.Steal != nil { - if obj.Steal.Table != "" && !dropIDs[obj.Steal.Table] { - issues = append(issues, Issue{ - Level: "ERROR", - Type: "reference", - Message: fmt.Sprintf("Object %q: steal.table %q does not exist", - id, obj.Steal.Table), - }) + for _, d := range obj.Steal.Drops { + if d.ItemID != "" && !itemIDs[d.ItemID] { + issues = append(issues, Issue{ + Level: "ERROR", + Type: "reference", + Message: fmt.Sprintf("Object %q: steal drop item %q does not exist", + id, d.ItemID), + }) + } + if d.Table != "" && !dropIDs[d.Table] { + issues = append(issues, Issue{ + Level: "ERROR", + Type: "reference", + Message: fmt.Sprintf("Object %q: steal drop table %q does not exist", + id, d.Table), + }) + } } if obj.Steal.GuardMob != "" && !mobIDs[obj.Steal.GuardMob] { -- cgit v1.2.3