Code was actually skipping setting color selection indices and previous commit actually broke mask selection in texture painting. All should work now.
Code was actually skipping setting color selection indices and previous commit actually broke mask selection in texture painting. All should work now.