From 8fe9e3c3fef0049df82281a62afe35dda516dfe2 Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Fri, 18 Sep 2026 17:48:26 -0400 Subject: fix: close combat ghost, admin traversal, login throttle, journal double-pay, and quality/economy gaps --- internal/game/core_validate.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'internal/game/core_validate.go') diff --git a/internal/game/core_validate.go b/internal/game/core_validate.go index b6cb3b9..a858933 100644 --- a/internal/game/core_validate.go +++ b/internal/game/core_validate.go @@ -16,13 +16,18 @@ func (g *Game) validationSource() validate.Source { courseViews := make([]validate.CourseView, 0, len(courses)) for id, cfg := range courses { rooms := make([]int, 0, len(cfg.Obstacles)) + failRooms := make([]int, 0, len(cfg.Obstacles)) for _, obs := range cfg.Obstacles { rooms = append(rooms, obs.RoomID) + if obs.OnFailRoom > 0 { + failRooms = append(failRooms, obs.OnFailRoom) + } } courseViews = append(courseViews, validate.CourseView{ ID: id, StartRoom: cfg.StartRoom, ObstacleRooms: rooms, + OnFailRooms: failRooms, }) } @@ -39,6 +44,7 @@ func (g *Game) validationSource() validate.Source { moduleElements := make(map[string]bool) moduleDestinations := make(map[string]int) + transportModules := make(map[string]bool) for _, m := range AllMods { if m.Element != "" { moduleElements[m.Element] = true @@ -46,6 +52,16 @@ func (g *Game) validationSource() validate.Source { if m.Destination > 0 { moduleDestinations[m.ID] = m.Destination } + if m.Category == ModTransport { + transportModules[m.ID] = true + } + } + + knownFieldTargets := []validate.KnownFieldTarget{ + {SubDir: "techs", Label: "tech", NewDef: func() any { return new(TechDef) }}, + {SubDir: "modules", Label: "module", NewDef: func() any { return new(ModDef) }}, + {SubDir: "courses", Label: "course", NewDef: func() any { return new(CourseConfig) }}, + {SubDir: "help", Label: "help topic", NewDef: func() any { return new(helpRaw) }}, } return validate.Source{ @@ -61,5 +77,7 @@ func (g *Game) validationSource() validate.Source { IgnoreUnreachable: g.ValidationConfig.IgnoreUnreachable, ModuleElements: moduleElements, ModuleDestinations: moduleDestinations, + TransportModules: transportModules, + KnownFieldTargets: knownFieldTargets, } } -- cgit v1.2.3