Bug - Fixed chez snootee foods not marked as "turn-free"

bleary

Member
The foods available from Chez Snootee should be marked as "turn free", as should the daily special.

Untitled.png
 

Catch-22

Active member
try r11640? I won't be able to test for.. months, at least.

It shows up with "no create" ticked, but not with "turn-free" ticked. Unfortunately I don't even have time to play at the moment, let alone offer a patch.

Edit:

Could this be written as an OR
Code:
if ( creation.getTurnFreeAvailable() == 0 && !KoLConstants.restaurantItems.contains( creation ) && !KoLConstants.microbreweryItems.contains( creation ) )
?

Code:
 if ( creation.getTurnFreeAvailable() == 0 || KoLConstants.restaurantItems.contains( creation ) || KoLConstants.microbreweryItems.contains( creation ) )
 
Last edited:

roippi

Developer
Hm, k. Object equality issue.

This one is probably going to languish unless someone else in an appropriate moon sign wants to tackle it.
 

Catch-22

Active member
Seeings as I'm in the appropriate moon sign, I could probably look at this in a few days time if work/life is less hectic.
 

roippi

Developer
Just now saw your edit. No, using (A OR B) instead of (A AND !B) doesn't help, though (A OR B) would work fine if contains() worked. However, it won't:

Code:
        CafeRequest.addMenuItem( KoLConstants.restaurantItems, "Peche a la Frog", 50 );
        CafeRequest.addMenuItem( KoLConstants.restaurantItems, "As Jus Gezund Heit", 75 );
        CafeRequest.addMenuItem( KoLConstants.restaurantItems, "Bouillabaise Coucher Avec Moi", 100 );

Code:
    protected static void addMenuItem( final LockableListModel menu, final String itemName, final int price )
    {
        [B]menu.add( itemName );[/B]

        LockableListModel usables = ConcoctionDatabase.getUsables();
        Concoction item = new Concoction( itemName, price );
        int index = usables.indexOf( item );
        if ( index != -1 )
        {
            CafeRequest.existing.add( usables.remove( index ) );
        }
        else
        {
            CafeRequest.existing.add( null );
        }
        [B]usables.add( item );[/B]
    }

So long story short, String != Concoction, always, so using contains() won't work like I wanted it to.

Ultimately I think I'd like getTurnFreeAvailable to return the right thing, instead of hardcoding stuff in UseItemEnqueuePanel. That might be overambitious, though, I dunno. Just adding some toStrings (or whatever) will probably fix things.
 

Catch-22

Active member
Ultimately I think I'd like getTurnFreeAvailable to return the right thing, instead of hardcoding stuff in UseItemEnqueuePanel.

Ah I was going to have a crack at this, anyway it's working now in the lazy way you suggested ;)

I was thinking, is there a reason why it couldn't be handled by the same logic that says urinal cakes etc. are turn free? I mean, they're all purchased from stores of sorts.
 

roippi

Developer
Restaurant items are not real items, so they are not actually included in concoction refreshes - KoLMafiaGUI adds them (hardcoded) to the usable list when creating the item manager frame.

It's a bit weird, but some concoction fields are meaningless for those pseudoitems, so yeah. We could make some public accessory method to set the turnFreeAvailable field, and then do that in ChezSnooteeRequest.getMenu(), but really it's all hardcoded hacks any way you slice it.
 
Top