Bug autoSatisfyWithCoinmasters cannot be set by scripts

erct657

Member
This may affect other preferences too. With autoscend, we set autoSatisfyWithCoinmasters to true (making a backup to respect the user's prior preferences if they have that set to false). A user tried to run autoscend in G-Lover. After we set some initial settings, like that one, we initialize our runs. To initialize our G-Lover runs, we
Code:
cli_execute("make "
a Crude Oil Congealer and A-Boo Glue if possible. The make command tries to access G-Mart. If the user has that setting as false prior to running autoscend, autoscend cannot access G-Mart. Specifically, we get the error "You have not selected the option to trade with coin masters." despite autoscend setting autoSatisfyWithCoinmasters to true. When autoSatisfyWithCoinmasters is set to true by the user prior to running autoscend, we get past that initial point with no issues.

So basically, it looks like Mafia caches that setting when a script is run and does not let a script override. I suppose that might be a feature and not a bug to prevent scripts from taking advantage of users?
 
I suspect that's more of an oversight, in that it also works in the other direction: if I temporarily disable autoSatisfyWithCoinmasters, Mafia still uses coinmasters despite the preference saying not to. However, if I force refreshConcoctions() (as with `refresh concoctions`), that clears the cache by calling ConcoctionsDatabase.refreshConcoctions(true) which calls refreshConcoctionsNow() which calls cachePermitted(availableIngredientsList)).

You are welcome to use that workaround for the time being.

What we probably ought to do is add a listener on this preference so we perform this refresh whenever the preference changes.

Example of the workaround in action below:

Code:
> make dinsey face

You have not selected the option to trade with coin masters.

> set autoSatisfyWithCoinmasters = true

autoSatisfyWithCoinmasters => true

> make dinsey face

You have not selected the option to trade with coin masters.

> refresh concoctions

> make dinsey face

Verifying ingredients for Dinsey face paint (1)...
Purchasing Dinsey face paint (1 @ 1 FunFunds™)...
Visiting the The Dinsey Company Store...
You acquire an item: Dinsey face paint
The Dinsey Company Store successfully looted!
Successfully created Dinsey face paint (1)
 
Back
Top