diff options
Diffstat (limited to 'internal/validate')
| -rw-r--r-- | internal/validate/checks.go | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/internal/validate/checks.go b/internal/validate/checks.go index 974998a..0fc5b8f 100644 --- a/internal/validate/checks.go +++ b/internal/validate/checks.go @@ -198,12 +198,9 @@ func validateLocalObject(roomID int, robj world.RoomObject, itemIDs map[string]b if len(def.UseInteractions) > 0 { bad = append(bad, "use_interactions") } - if def.StealTable != "" || def.StealLevel != 0 || def.StealXP != 0 || def.StealSpeed != 0 { + if def.Steal != nil { bad = append(bad, "steal") } - if def.GuardMob != "" { - bad = append(bad, "guard_mob") - } if def.RemovalItem != "" { bad = append(bad, "removal_item") } @@ -548,22 +545,24 @@ func validateObjects(s Source) []Issue { }) } - if obj.StealTable != "" && !dropIDs[obj.StealTable] { - issues = append(issues, Issue{ - Level: "ERROR", - Type: "reference", - Message: fmt.Sprintf("Object %q: steal_table %q does not exist", - id, obj.StealTable), - }) - } + 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), + }) + } - if obj.GuardMob != "" && !mobIDs[obj.GuardMob] { - issues = append(issues, Issue{ - Level: "ERROR", - Type: "reference", - Message: fmt.Sprintf("Object %q: guard_mob %q does not exist", - id, obj.GuardMob), - }) + if obj.Steal.GuardMob != "" && !mobIDs[obj.Steal.GuardMob] { + issues = append(issues, Issue{ + Level: "ERROR", + Type: "reference", + Message: fmt.Sprintf("Object %q: steal.guard_mob %q does not exist", + id, obj.Steal.GuardMob), + }) + } } for _, ui := range obj.UseInteractions { |
