Bug - Fixed When breakable equipment breaks, don't stop adventuring.

bumcheekcity

Active member
Code:
cli_execute("set conditions something");
adventure(my_adventures(), $location[the first place]);
adventure(my_adventures(), $location[the second place]);

I would expect the above code to adventure in [the first place] until the conditions are satisfied, and then in [the second place] when said conditions are met.

I have breakable equipment set to "equip previous" and I have a sugar shirt on. When the sugar shirt breaks, it tries to equip my previous, sees that I have no other shirts, stops adventuring in [the first place] and starts in [the second place]. I haven't confirmed what happens yet when I DO actually have another shirt to equip.

This strikes me as the behaviour I would not expect, but could well be a feature. Either way, is it possible to get behaviour that will continue adventuring in [the first place], regardless of what shirt I equip after my sugar shirt breaks (including if I don't have another shirt to equip)?
 

Winterbay

Active member
If you have another sugar shirt it will just continue to adventure in place 1 after having replaced it. That much I know :)
 

Bale

Minion
The feature you desire is already part of mafia. This is a configurable behavior.

Go to Adventuring Tab -> Choice Advs -> Item

You'll find a drop-down for breakable equipment.
 

StDoodle

Minion
Bale, he's saying that he already has that set, and to "equip previous," which would seem to be what's desired.
 

Winterbay

Active member
The problem arises when you have no more of the item you want to reequip and a script is adventuring with a condition. When the condition is reached Mafia stops automation and in the scripts case moves on to the next line. The same thing happens if you have a condition set and a breakable item on and no more of that item when it breaks. Which I'd say is undesirable behaviour but I'm not sure how to fix it.
 

slyz

Developer
I think Mafia is behaving as expected: you give it a command to adventure, something stops it from adventuring before the goals are met, and you give another command to adventure regardless of what happened with the first adventure().

Maybe you should check if adventure() returns false when Mafia stops adventuring because it can't replace your broken equipment. If so, this should work:
Code:
cli_execute("set conditions something");
while( !adventure(my_adventures(), $location[the first place]) ) {}
while( !adventure(my_adventures(), $location[the second place]) ) {}
 

picklish

Member
I'll second this feature request. It would be nice to have a "ignore" option here that will never abort. "Re-equip from inventory or previous" suspiciously looks like an option that won't abort, but if you have no previous shirt and are unable to re-equip, then it will.
 

Veracity

Developer
Staff member
I think it was a bug, not a missing feature: if you select "re-equip from inventory or previous", it shouldn't stop automation if there wasn't a previous. Revision 10486 prints an informational message if there was no previous item and doesn't stop automation.

Now, I suppose if you really did have a previous item and your between battle script sold it, or something, we probably should stop, and this revision will make it not stop, but if you do something like that, you deserve what you get. :)
 
Top