diff options
Diffstat (limited to 'internal/validate')
| -rw-r--r-- | internal/validate/checks.go | 26 |
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), }) } } |
