Bug - Fixed Property "_blankoutUsed" doesn't ever change

Aenimus

Member
Hello,

_blankoutUsed never changes when using a bottle of Blank-Out.

Code:
> ash $item[bottle of blank-out].use()

Using 1 bottle of Blank-Out...
You acquire an item: glob of Blank-Out
Finished using 1 bottle of Blank-Out.
Returned: true

> prefref blank

Name Value Default Scope
_blankoutUsed false false user

The source code looks fine:

Code:
        case ItemPool.BLANK_OUT_BOTTLE:
            if ( KoLCharacter.isJarlsberg() && responseText.contains( "mess with this crap" ) )
            {
                UseItemRequest.lastUpdate = "Jarlsberg hated getting his hands dirty. There is no way he would mess with this crap.";
                KoLmafia.updateDisplay( MafiaState.ERROR, UseItemRequest.lastUpdate );
                return;
            }

            Preferences.setBoolean( "_blankoutUsed", true );
            break;

I also used network inspector for the HTML with Gausie to try to debug.

Any ideas?
 

gausie

D̰͕̝͚̤̥̙̐̇̑͗̒e͍͔͎͈͔ͥ̉̔̅́̈l̠̪̜͓̲ͧ̍̈́͛v̻̾ͤe͗̃ͥ̐̊ͬp̔͒ͪ
Staff member
It seems that because the bottle of blank-out is a single use creation it never actually gets to the item switch
 

gausie

D̰͕̝͚̤̥̙̐̇̑͗̒e͍͔͎͈͔ͥ̉̔̅́̈l̠̪̜͓̲ͧ̍̈́͛v̻̾ͤe͗̃ͥ̐̊ͬp̔͒ͪ
Staff member
This fixes the bug, but I'm not sure if there's a better way so I won't commit it just yet. Are there any other items that are SUSE or MUSE but also have some secondary effect like altering a preference? Should they still be SUSE/MUSE if they do so?
 

Attachments

  • blankout.patch
    2.2 KB · Views: 10

gausie

D̰͕̝͚̤̥̙̐̇̑͗̒e͍͔͎͈͔ͥ̉̔̅́̈l̠̪̜͓̲ͧ̍̈́͛v̻̾ͤe͗̃ͥ̐̊ͬp̔͒ͪ
Staff member
As an example of prior art, "picky tweezers" are saved this bug because they are not part of a concoction that creates "single atoms". Thus the daily use flag is set, but you can't run "make single atom" in the CLI. Which I suppose you probably should be able to do.
 

lostcalpolydude

Developer
Staff member
You also can't "make toast" to use a cheap toaster.

I'm surprised blank-out is SUSE. Maybe that made more sense before it was 1/day.
 

Veracity

Developer
Staff member
I assume it was so that you could "acquire glob of blank-out".
I actually sort of like "make toast".
Haven't looked at patch, yet. No opinion, as of yet, on what the "right" solution is.
 

gausie

D̰͕̝͚̤̥̙̐̇̑͗̒e͍͔͎͈͔ͥ̉̔̅́̈l̠̪̜͓̲ͧ̍̈́͛v̻̾ͤe͗̃ͥ̐̊ͬp̔͒ͪ
Staff member
All this patch does is add an item id switch to the SingleUseRequest result processor, and move the bottle of blank out handling from UseItemRequest where it is never run. We could easily add SUSE concoctions for other similar items and handle the daily flag etc management there.
 

Veracity

Developer
Staff member
All this patch does is add an item id switch to the SingleUseRequest result processor, and move the bottle of blank out handling from UseItemRequest where it is never run. We could easily add SUSE concoctions for other similar items and handle the daily flag etc management there.
I looked at the patch. Looks like a sound approach. Submit it!
 

gausie

D̰͕̝͚̤̥̙̐̇̑͗̒e͍͔͎͈͔ͥ̉̔̅́̈l̠̪̜͓̲ͧ̍̈́͛v̻̾ͤe͗̃ͥ̐̊ͬp̔͒ͪ
Staff member
Top