6E59: Fixing the examine supporters rule

Just for kicks, I’m trying to fix the bug in the examine supporters rule. Replacing the rule with my own version of the rule is as far as I’ve gotten. The original rule says, “issue library message looking action number 4 for the noun”. That message may be where the problem is.

It appears this message is in Language.i6t. This seems to be the code:

Look: switch (n) { 1: print " (on ", (the) x1, ")"; 2: print " (in ", (the) x1, ")"; 3: print " (as ", (object) x1, ")"; 4: print "On ", (the) x1, " "; WriteListFrom(child(x1), ENGLISH_BIT+RECURSE_BIT+PARTINV_BIT+TERSE_BIT+CONCEAL_BIT+ISARE_BIT); ".";

My first guess was that the player is concealed but not scenery or vice-versa, as that might run afoul of the conditions … but that appears not to be the case, because if I edit the rule like this…

if something which is not concealed is on the noun: if something which is not scenery is on the noun:

…nothin’ changes. The bug is still there. So maybe I’m totally misunderstanding the situation. Can anyone enlighten me? Thanks!

–JA

Okay, there’s a really easy solution:

The player is scenery.

So my next question is, will that code cause problems elsewhere?

For reference, in case you haven’t run into this bug: If the player is on an enterable supporter and there is nothing else on the supporter, ‘x supporter’ produces an extra line of bogus text.

–JA

Scenery is usually fixed in place, so perhaps “The player is scenery, not fixed in place.”

I’m using that line, and haven’t had a problem so far.

BTW, didn’t Emily fix that bug? I thought she or someone posted the new code for it in response to Al.

It’s still there. It only appeared in the new build, I believe, so it probably won’t be fixed for at least a year.

It is likely that there will be a maintenance build in a month or two to address some of the issues in 6E59. Things that are listed as “resolved” in the bug tracker should appear then. (“Closed” happens when we’ve decided that something isn’t a legitimate bug, or else it has already appeared in a released build.)

In the meantime, exempting the player specifically is, I think, enough to resolve this issue; the patch I submitted to the standard rules is as follows:

===

Carry out examining (this is the examine containers rule):
if the noun is a container:
if the noun is open or the noun is transparent:
if something which is not scenery is in the noun and something which is not the player is in the noun:
issue library message searching action number 7 for the noun;
now examine text printed is true;
otherwise if examine text printed is false:
if the player is in the noun:
make no decision;
issue library message searching action number 6 for the noun;
now examine text printed is true;

Carry out examining (this is the examine supporters rule):
if the noun is a supporter:
if something which is not scenery is on the noun and something which is not the player is on the noun:
issue library message looking action number 4 for the noun;
now examine text printed is true.

===

“Concealed” in I7 refers to the concealing relation – it’s no longer a flag as in I6 – so it means something different here. What was the concealed flag in I6 is now not used except that, in the core of the list-writer, it is still shorthand for “don’t mention the player himself”.

A little twisty, but we’ve tested the patch against all of our examples and test cases, and added a new test case that tests a variety of examining-objects-you’re-inside situations. So I think this should be solid.