A2TC-YT / D2AutoSplitter

An AutoSplitter for Destiny 2 speedrunning
4 stars 0 forks source link

Does not work on all white or all black images #2

Open GrimgarD2 opened 2 months ago

GrimgarD2 commented 2 months ago

I wanted to use an all black image to split on the removal of a UI element, but it kept breaking

After some investigation its due to a divide by zero issue in the color check function within the Destiny 2 AutoSplitter.ahk file

specifically lines 776-780: pCorrect := Round((((bCorrect/makeBlack) + (wCorrect/makeWhite))/2), 2) PercCorrectForGui := Round((pCorrect100), 0) WhiteCorrectForGui := Round((wCorrect/makeWhite100), 0) BlackCorrectForGui := Round((bCorrect/makeBlack*100), 0) return pCorrect

in my use case makeWhite := 0 as there are no white pixels therefore wCorrect/makeWhite results in a divide by zero error

A2TC-YT commented 2 months ago

image