aboutsummaryrefslogtreecommitdiff
path: root/internal/game/core_validate.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-09-18 15:16:44 -0400
committerhistoria <[not public]>2026-09-18 15:16:44 -0400
commit7eab582d8a8ee2af1a6baae7baf0696c7005de2e (patch)
tree902bbc8c6e39c9f62f779ca23267714ec420b9f5 /internal/game/core_validate.go
parent153acb7f644d755c45533b7c5311e3ffa47e8973 (diff)
downloadthehouseoficarus-7eab582d8a8ee2af1a6baae7baf0696c7005de2e.tar.gz
fix: harden triggers, economy, casino, world data, and admin/net paths
Diffstat (limited to 'internal/game/core_validate.go')
-rw-r--r--internal/game/core_validate.go33
1 files changed, 23 insertions, 10 deletions
diff --git a/internal/game/core_validate.go b/internal/game/core_validate.go
index 0e302c0..b6cb3b9 100644
--- a/internal/game/core_validate.go
+++ b/internal/game/core_validate.go
@@ -37,16 +37,29 @@ func (g *Game) validationSource() validate.Source {
techIDs[t.ID] = true
}
+ moduleElements := make(map[string]bool)
+ moduleDestinations := make(map[string]int)
+ for _, m := range AllMods {
+ if m.Element != "" {
+ moduleElements[m.Element] = true
+ }
+ if m.Destination > 0 {
+ moduleDestinations[m.ID] = m.Destination
+ }
+ }
+
return validate.Source{
- DataDir: g.DataDir,
- Items: g.ItemStore,
- Objects: g.ObjectStore,
- Mobs: g.MobStore,
- World: g.World,
- Courses: courseViews,
- Techs: techViews,
- TechIDs: techIDs,
- RootRooms: g.ValidationConfig.RootRooms,
- IgnoreUnreachable: g.ValidationConfig.IgnoreUnreachable,
+ DataDir: g.DataDir,
+ Items: g.ItemStore,
+ Objects: g.ObjectStore,
+ Mobs: g.MobStore,
+ World: g.World,
+ Courses: courseViews,
+ Techs: techViews,
+ TechIDs: techIDs,
+ RootRooms: g.ValidationConfig.RootRooms,
+ IgnoreUnreachable: g.ValidationConfig.IgnoreUnreachable,
+ ModuleElements: moduleElements,
+ ModuleDestinations: moduleDestinations,
}
}