aboutsummaryrefslogtreecommitdiff
path: root/internal/validate/checks.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-07-01 02:21:42 -0400
committerhistoria <[not public]>2026-07-01 02:21:42 -0400
commit5f37dc9b6f6b79da04da70ae0c33ec8d02998587 (patch)
treef7c309e36267a4c456fcf5bca800e614507a80af /internal/validate/checks.go
parentfee376102192dc6f24297a7b11324636ace3a07d (diff)
downloadthehouseoficarus-5f37dc9b6f6b79da04da70ae0c33ec8d02998587.tar.gz
feat: qol improvements to items crud in admin gui
Diffstat (limited to 'internal/validate/checks.go')
-rw-r--r--internal/validate/checks.go26
1 files changed, 11 insertions, 15 deletions
diff --git a/internal/validate/checks.go b/internal/validate/checks.go
index 50fd9a5..b35a3de 100644
--- a/internal/validate/checks.go
+++ b/internal/validate/checks.go
@@ -535,15 +535,6 @@ func validateItems(s Source) []Issue {
})
}
- if def.SearchMiscTable != "" && !dropIDs[def.SearchMiscTable] {
- issues = append(issues, Issue{
- Level: "ERROR",
- Type: "reference",
- Message: fmt.Sprintf("Item %q: search_misc_table %q does not exist",
- id, def.SearchMiscTable),
- })
- }
-
if def.FarmProduct != "" && !itemIDs[def.FarmProduct] {
issues = append(issues, Issue{
Level: "ERROR",
@@ -579,14 +570,19 @@ func validateCraftBlocks(s Source) []Issue {
for ci := range item.Craft {
c := &item.Craft[ci]
- for _, e := range c.Consume {
- for _, consumeItem := range e.Items {
- if consumeItem != "" && !itemIDs[consumeItem] {
+ craftLabel := c.Type
+ if c.Subtype != "" {
+ craftLabel = c.Type + "/" + c.Subtype
+ }
+
+ for _, e := range c.Ingredients {
+ for _, ingredientID := range e.Items {
+ if ingredientID != "" && !itemIDs[ingredientID] {
issues = append(issues, Issue{
Level: "ERROR",
Type: "reference",
Message: fmt.Sprintf("Item %q (craft: %s): consumes nonexistent item %q",
- item.ID, c.Type, consumeItem),
+ item.ID, craftLabel, ingredientID),
})
}
}
@@ -597,7 +593,7 @@ func validateCraftBlocks(s Source) []Issue {
Level: "ERROR",
Type: "reference",
Message: fmt.Sprintf("Item %q (craft: %s): fail product %q does not exist",
- item.ID, c.Type, c.Fail),
+ item.ID, craftLabel, c.Fail),
})
}
@@ -607,7 +603,7 @@ func validateCraftBlocks(s Source) []Issue {
Level: "ERROR",
Type: "reference",
Message: fmt.Sprintf("Item %q (craft: %s): station object %q does not exist",
- item.ID, c.Type, sid),
+ item.ID, craftLabel, sid),
})
}
}