aboutsummaryrefslogtreecommitdiff
path: root/internal/game/act.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-06-27 21:25:20 -0400
committerhistoria <[not public]>2026-06-27 21:25:20 -0400
commit87dacfbb3dd16e7f55a82361eace98f9a39d75c8 (patch)
treed548f75a37b5b8e960c5e5d111237e172650bb59 /internal/game/act.go
parent83f8f5447ec3baf85314ce7343f0e339d28bcc15 (diff)
downloadthehouseoficarus-87dacfbb3dd16e7f55a82361eace98f9a39d75c8.tar.gz
feat: room-specific objects can be defined inline in room yaml
Diffstat (limited to 'internal/game/act.go')
-rw-r--r--internal/game/act.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/internal/game/act.go b/internal/game/act.go
index 78f298d..654b65c 100644
--- a/internal/game/act.go
+++ b/internal/game/act.go
@@ -105,8 +105,12 @@ func (g *Game) startAction(sess *net.Session, verb, target string) {
return
}
var err error
- obj, err = g.ObjectStore.Load(chosen.DefID)
- if err != nil || !obj.IsInteractable() {
+ obj, err = g.resolveObjectDef(p.RoomID, chosen.DefID)
+ if err != nil {
+ sess.WriteLine(fmt.Sprintf("There's nothing here to %s.", verb))
+ return
+ }
+ if !obj.IsInteractable() {
sess.WriteLine(fmt.Sprintf("You can't %s the %s.", verb, obj.Name))
return
}