Possible bug in adv3lite

Howdy.

I believe the intent of the below in precond.t was to iterate over all possible attachables and return true when empty and nil when the first one failed. It seems to be missing the curly braces.

  foreach(local cur in obj.attachedToList)
                tried = tryImplicitAction(DetachFrom, obj, cur);
            
            /*  
             *   If obj is now not attached to anything return true to signal
             *   that this precondition has now been met.
             */
            if(obj.attachedToList.length == 0)
               return true;
            
            /* 
             *   Otherwise, if we tried but failed to detach obj, return nil to
             *   signal that this precondition can't be met (so the main action
             *   cannot proceed). The attempt to detach obj will have explained
             *   why it failed, so there's no need for any further explanation
             *   here.
             */
            if(tried)
                return nil;

Thanks.

4 Likes

(I moved this topic from General Design Discussion to the TADS forum and added the adv3lite tag.)

2 Likes

That’s right; good catch, I’ve now corrected this and uploaded the correction to GitHub. It will, of course, also be included in the version 2.1.1 release I’m planning for ealy next month.

4 Likes

I think i found another bug.

In english.t, line 3073 it iterates through contents and marks it as mentioned. However, the items may not have been mentioned if the lookListed property is false.

I think it might be safer to do something like

s.contents.subset({ o: listed(o) }).forEach({x: x.mentioned = true});

Where I saw this show up was in a remote senseRegion with an item (in this case an Actor) with a specialDesc inside of another item.

Thanks!

2 Likes

For the same issue (marking mentioned items that were not), I also needed to address lister.t line 128 (same solution).

2 Likes

Thanks for this. I’ve now incorporated these fixes and uploaded them to GitHub.

3 Likes