sketchbook: behavior.SetFiltersDisabled counts as a move

Started by LociOiling

LociOiling Lv 1

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)

LociOiling Lv 1

The function save.LoadSecondaryStructure also takes a move. Setting the secondary structure manually or using structure.SetSecondaryStructure doesn't cost moves.

LociOiling Lv 1

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.

LociOiling Lv 1

In 20180725-d14dae34c3-win_x86-devprev, behavior.SetFiltersDisabled(false) no longer costs a move, but save.LoadSecondaryStructure () and ctrl-9 do use a move.