UncannyCookieClicker icon indicating copy to clipboard operation
UncannyCookieClicker copied to clipboard

Update gameClient.js to fix the Cookie Storm problem.

Open awes12 opened this issue 11 months ago • 0 comments

There is a classic async problem in the clickGoldenCookie function. The setTimeout just tries to repop the golden cookie in 500 ms, but it doesn't take into account that the cookie might have already been popped within that time (ex: by the autoclicker), which ends up meaning that you try to pop the cookie twice (which has a lot of bad side effects).

I fixed this by just making sure that the golden cookie hasn't been popped before popping it in the async setTimeout .

awes12 avatar Jul 10 '23 22:07 awes12