The happiness state would sometimes get set to a state greater than the MAX_HAPPINESS value.
The advanceRound detection was based on when happiness === MAX_HAPPINESS, and the Math.min was using 100 instead of MAX_HAPPINESS. This would sometimes cause the happiness to go over MAX_HAPPINESS and the game would be stuck.
I have a video demonstrating the bug attached.
This bug was pretty hard to test, so I'm not sure if I fixed it. From a logically standpoint, I think it is fixed now.
Thanks for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).
https://user-images.githubusercontent.com/56695604/120063607-e2b40d00-c01c-11eb-9d4f-c472d9e0aa0e.MOV
The happiness state would sometimes get set to a state greater than the MAX_HAPPINESS value. The advanceRound detection was based on when happiness === MAX_HAPPINESS, and the Math.min was using 100 instead of MAX_HAPPINESS. This would sometimes cause the happiness to go over MAX_HAPPINESS and the game would be stuck. I have a video demonstrating the bug attached.
This bug was pretty hard to test, so I'm not sure if I fixed it. From a logically standpoint, I think it is fixed now.