sketchbook: behavior.SetFiltersDisabled counts as a move
Case number: | 699969-2005475 |
Topic: | General |
Opened by: | LociOiling |
Status: | Closed |
Type: | Bug |
Opened on: | Saturday, July 7, 2018 - 18:21 |
Last modified: | Monday, July 30, 2018 - 21:28 |
I noticed that some common recipes leak moves before they display an initial dialog.
It turns out that SetFiltersDisabled is the culprit. Recipes may check the filter bonus by first enabling filters (just to be sure), getting the score, disabling the filters and getting the score, then enabling the filters again. The current filter bonus is the difference in the two scores, but the recipe just leaked three moves without doing anything.
Administrative calls like behavior.SetFiltersDisabled shouldn't deduct moves.
This problem is easy to work around with quicksave and quickload.
The following one-line recipes demonstrates the issue:
behavior.SetFiltersDisabled(false)
This should be fixed in the latest devprev - thanks for the report!
Fast work, SetFiltersDisabled no longer costs a move in devprev.
However, save.LoadSecondaryStructure () is still costing a move. Changing secondary structure manually does not cost anything. I missed this previously, but loading secondary structures via control + 9 also costs a move.
The new structure.SetSecondaryStructureSelected ( "a" ) seems to work, and does not cost a move.
I think save.LoadSecondaryStructure () and ctrl-9 should be free.
In 20180725-d14dae34c3-win_x86-devprev, behavior.SetFiltersDisabled(false) no longer costs a move, but save.LoadSecondaryStructure () and ctrl-9 do use a move.
Status: Open » Closed |
Closing this one out, see https://fold.it/portal/node/2004001 for the LoadSecondaryStructure part of the problem.
The function save.LoadSecondaryStructure also takes a move. Setting the secondary structure manually or using structure.SetSecondaryStructure doesn't cost moves.