Skip to content

Conversation

AviKohn7
Copy link

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 .

There is a classic async problem here. 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 (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 cookie hasn't been popped yet before popping it in the async function.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant