Bug - Fixed "drink" doesn't equip previous pants after equipping Travoltan trousers to buy ingredients

Ryo_Sangnoir

Developer
Staff member
Triggered by an ash command: drink(1, $item[elemental caipiroska]);

Mafia works out that the cheapest option is to buy fermenting powder and a bowl of rye sprouts. It equips the Travoltan trousers to make buying cheaper, but doesn't restore the previous pants.

Commands like "acquire" successfully restore the previous pants.
 
Code:
        String limitmode = KoLCharacter.getLimitmode();

       try ( Checkpoint checkpoint = new Checkpoint( KoLCharacter.getLimitmode() == limitmode ) )
        {
            UseItemCommand.use( command, parameters );
        }
Did somebody break outfit checkpoints? Actually, it looks that Checkpoint is always created with "true" - which means "don't restore".

I seem to recall a change where all uses of Checkpoints were changed to use try-with-resources. Looks like a bug was introduced.
 
Huh, I'll look at what I changed it from and fix it
 
I actually can't work out what this used to do

I assume it always resolved to false - it seems to have always been this way. The only thing I can think of is that the limit mode can change mid-item use? In any case, I've fixed it by letting Checkpoint defer that check. Hooray for Java 8! r20718
 
Back
Top