diff options
| author | historia <[not public]> | 2026-10-06 12:57:23 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-10-06 12:57:23 -0400 |
| commit | 9666676766bf21364f4fc4d0d1d336e72f2a91b4 (patch) | |
| tree | 0cade34091d7602790dc38cd44053f0b74bbadf2 /internal/object | |
| parent | 4bc1daaf259e0c19c5fe4a12ec8bc7f6e5a735c1 (diff) | |
| download | thehouseoficarus-9666676766bf21364f4fc4d0d1d336e72f2a91b4.tar.gz | |
refactor: split casino.go, dedup helpers, remove audit docs
Diffstat (limited to 'internal/object')
| -rw-r--r-- | internal/object/object.go | 5 | ||||
| -rw-r--r-- | internal/object/object_test.go | 13 | ||||
| -rw-r--r-- | internal/object/store.go | 1 |
3 files changed, 17 insertions, 2 deletions
diff --git a/internal/object/object.go b/internal/object/object.go index 376f4be..e0a5b16 100644 --- a/internal/object/object.go +++ b/internal/object/object.go @@ -70,8 +70,9 @@ func (d *ObjectDef) BehaviorType() string { return "gather" case d.Talk != nil: return "talk" - case d.Safespot != nil: - return "safespot" } + // Safespot (and any other passive/use-driven object) is not an ActionType + // verb. Returning a non-ActionType string here would make the verb gate in + // startAction reject "use"-style verbs against it. return "" } diff --git a/internal/object/object_test.go b/internal/object/object_test.go new file mode 100644 index 0000000..251dc61 --- /dev/null +++ b/internal/object/object_test.go @@ -0,0 +1,13 @@ +package object + +import "testing" + +// TestBehaviorTypeSafespotIsNotActionType: BehaviorType must not return +// "safespot" (it is not a behavior.ActionType), or the generic verb gate +// treats a safespot-only object as an unknown action type. +func TestBehaviorTypeSafespotIsNotActionType(t *testing.T) { + def := &ObjectDef{Safespot: &SafespotConfig{}} + if got := def.BehaviorType(); got != "" { + t.Fatalf("BehaviorType(safespot-only) = %q, want empty", got) + } +} diff --git a/internal/object/store.go b/internal/object/store.go index ee154cf..e974186 100644 --- a/internal/object/store.go +++ b/internal/object/store.go @@ -77,6 +77,7 @@ func (s *ObjectStore) IDSet() map[string]bool { func (s *ObjectStore) Reload(dataDir string) { s.mu.Lock() defer s.mu.Unlock() + s.dataDir = dataDir s.cache = make(map[string]*ObjectDef) s.pathIndex = behavior.BuildPathIndex(filepath.Join(dataDir, "objects")) } |
