ainslec / adventuron-issue-tracker

Adventuron Issues Tracker
4 stars 0 forks source link

[BUG / CONFIG?] "r -" and "l -" both map to whichever is the first match. #457

Closed nww02 closed 2 years ago

nww02 commented 3 years ago

If you attempt to watch for the commands "r" and "l", then they seem to be aliases out of the box, so both will cause whichever is listed first to fire.

Is there a way to "de-alias" them? Should it be like this, or is it a bug?

start_at = my_location

locations {
   my_location : location "You are in a room." ;
}

on_command {
   :match "r -" {
      :print "You typed 'r'";
      :done;
   }

   :match "l -" {
      :print "You typed 'l'";
        :done;
   }
}

As demonstrated here...

image

Even adding them as separate items in the vocab still has them tied together:-

image

nww02 commented 3 years ago

I have a workaround, which is:-

image

this seems to allow it to drop through into the other handler.

ainslec commented 3 years ago

if (original "verb" == "l") { .... }

On Wed, Jun 30, 2021 at 4:44 PM nww02 @.***> wrote:

I have a workaround, which is:-

[image: image] https://user-images.githubusercontent.com/46803513/123991210-6e291100-d9c2-11eb-8102-82b02aae5dd7.png

this seems to allow it to drop through into the other handler.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ainslec/adventuron-issue-tracker/issues/457#issuecomment-871515920, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABRJDU7HJFS5FYUPDA5XVDTVM3XJANCNFSM47STEWTA .

nww02 commented 3 years ago

Yeah, that works too. So it's not a biggie, but might trip someone up if they're trying to implement "right" and "left" as directions :)

ainslec commented 2 years ago

Closing this as any "solution" would require quite a lot of static analysis, and it's technically a feature not a bug.