aboutsummaryrefslogtreecommitdiff
path: root/internal/validate
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-07-08 02:23:59 -0400
committerhistoria <[not public]>2026-07-08 02:23:59 -0400
commit2bbe6b8e912bbc5f4a61a33988fb27aca7bd5eb3 (patch)
treeef4aef5a7393de51d765b24d565b414ddac4b9fe /internal/validate
parent71f0f381de64e045f91da19450adacf10fbc7902 (diff)
downloadthehouseoficarus-2bbe6b8e912bbc5f4a61a33988fb27aca7bd5eb3.tar.gz
feat: object and mob steal tables can include both tables and items
Diffstat (limited to 'internal/validate')
-rw-r--r--internal/validate/checks.go50
1 files changed, 36 insertions, 14 deletions
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] {