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.

3 Likes