heasm66 / mdlzork

Different versions of original mainframe Zork reconstructed and patched to run under Confusion.
15 stars 6 forks source link

Objects with ODESCO can be listed twice in the room's description #40

Closed eriktorbjorn closed 1 year ago

eriktorbjorn commented 1 year ago

This is how I first encountered the problem:

>LOOK
West of House
This is an open field west of a white house, with a boarded front door.
There is a small mailbox here.
In the mailbox is a large brochure.
 The free brochure contains:
  A Don Woods stamp
The mailbox also contains:
 A free brochure
 The free brochure contains:
  A Don Woods stamp
 A leaflet
A rubber mat saying 'Welcome to Zork!' lies by the door.

It only happens if there is more than one object in the mailbox. At first I thought the simplest solution would be to just remove ODESCO from the free brochure, but it turns out I can also reproduce it elsewhere:

>LOOK
Up a Tree
You are about 10 feet above the ground nestled among some large
branches.  The nearest branch above you is above your reach.
On the branch is a small birds nest.
In the bird's nest is a large egg encrusted with precious jewels,
apparently scavenged somewhere by a childless songbird.  The egg is 
covered with fine gold inlay, and ornamented in lapis lazuli and
mother-of-pearl.  Unlike most eggs, this one is hinged and has a
delicate looking clasp holding it closed.  The egg appears extremely
fragile.
The birds nest also contains:
 A leaflet
 A jewel-encrusted egg

So it may be that the only proper solution is to bite the bullet and fix (probably) PRINT-CONT ... but that's way above my meager MDL abilities.

heasm66 commented 1 year ago

Verfied that it's the same behaviour on ITS.

(Don't sell yourself short. You're probably among the worlds top 100 programmers in MDL.)

heasm66 commented 1 year ago

Potential solution is to only print objects that are touched (or don't have an ODESCO) in the contains:/also contains: bit.

Change line 719 in rooms.mud (PRINT-CONT) to: (<AND <TRNN .Y ,OVISON> <OR <TRNN .Y ,TOUCHBIT> <EMPTY? <ODESCO .Y>>>

eriktorbjorn commented 1 year ago

I was thinking along those lines, but I wasn't sure I'd get it right.

By the way, while Zork I doesn't print "also", it seems to have the problem pretty well fixed:

>LOOK
Egyptian Room
This is a room which looks like an Egyptian tomb. There is an ascending
staircase to the west.
The solid-gold coffin used for the burial of Ramses II is here.
A sceptre, possibly that of ancient Egypt itself, is in the coffin. The sceptre
is ornamented with colored enamel, and tapers to a sharp point.
The gold coffin contains:
  A bird's nest
In the bird's nest is a large egg encrusted with precious jewels, apparently
scavenged by a childless songbird. The egg is covered with fine gold inlay, and
ornamented in lapis lazuli and mother-of-pearl. Unlike most eggs, this one is
hinged and closed with a delicate looking clasp. The egg appears extremely
fragile.

And while I'm almost as confused about the ZIL version of PRINT-CONT, it does seem to check for TOUCHBIT and FDESC before printing an object in a container. So this is probably on the right track.

larsbrinkhoff commented 1 year ago

Are you (directing this to both @heasm66 and @eriktorbjorn) considering submitting fixes to upstream https://github.com/PDP-10/its?

heasm66 commented 1 year ago

@larsbrinkhoff Yes, I'm at least planning on reporting them. Then there's a discussion about preserving historical accuracy vs fixing minor bugs.