trinity icon indicating copy to clipboard operation
trinity copied to clipboard

Calling SAID-CRUMBS? from EBAG doesn't work as intended

Open eriktorbjorn opened this issue 5 years ago • 2 comments

EBAG-F has this, which is apparently there to check if you refer to the empty (or soggy) bag as "crumbs":

<ROUTINE EBAG-F ()
	 <COND (<SAID-CRUMBS?>
		<TELL "The crumbs are all gone." CR>
		<RFATAL>)

But it doesn't work. Probably because the first thing SAID-CRUMBS? does is to check if you're carrying the full bag of crumbs (BAG):

<ROUTINE SAID-CRUMBS? ()
	 <COND (<NOT <IN? ,BAG ,PLAYER>>
		<RFALSE>)

eriktorbjorn avatar Sep 16 '20 18:09 eriktorbjorn

Similarly, the CRUMBS-GONE? routine will only work if you are carrying the bag of crumbs, even though it's clearly meant to work if you are carrying the empty or soggy bag as well:

<ROUTINE CRUMBS-GONE? ()
	 <COND (<NOT <SAID-CRUMBS?>>
		<RFALSE>)
	       (<PRSO? BAG>
		<TAKE-CRUMBS>
		<RTRUE>)
	       (<PRSO? EBAG SOGGY>
		<TELL "The crumbs are all gone." CR>
		<RTRUE>)>
	 <RFALSE>>

This routine is called from:

  • PRE-GIVE
  • PRE-PUT
  • PRE-THROW
  • PRE-TAKE

eriktorbjorn avatar Oct 05 '20 07:10 eriktorbjorn

The SAID-CRUMBS? routine is called from:

  • GWIM, where it already checks if you mean the BAG object.
  • BAG-F, so that should already be the BAG object.
  • EBAG-F, as described above.
  • CRUMBS-GONE?, as described above.

So I guess it should be safe to remove that check from SAID-CRUMBS?? Or did I miss something?

eriktorbjorn avatar Oct 05 '20 07:10 eriktorbjorn