aboutsummaryrefslogtreecommitdiff
path: root/internal/world/room.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/world/room.go')
-rw-r--r--internal/world/room.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/internal/world/room.go b/internal/world/room.go
index e200f32..9b9bef7 100644
--- a/internal/world/room.go
+++ b/internal/world/room.go
@@ -171,6 +171,13 @@ func (ro *RoomObject) UnmarshalYAML(value *yaml.Node) error {
ro.Local = &def
return nil
}
+ // A reference entry (no name/description) that also carries behavior
+ // fields silently loses them at runtime, because the loader always uses
+ // the object file. Reject it instead of discarding authored behavior.
+ if def.RemovalItem != "" || len(def.OnUse) > 0 || def.Steal != nil ||
+ def.Gather != nil || def.Talk != nil || def.Safespot != nil {
+ return fmt.Errorf("room object entry %q cannot carry behavior (on_use/gather/talk/steal/removal_item/safespot); define it in objects/%s.yaml or give the entry a name", ref.ID, ref.ID)
+ }
ro.ID = ref.ID
ro.HiddenOverride = ref.Hidden
return nil