Killing too many kittens fails in Firefox

Issue #9 resolved
Former user created an issue

The following code broke in Firefox, with an error about invalid array length:

killKittens: function(amount){ this.kittens.length -= amount; if (this.kittens.length < 0){ this.kittens.length = 0; }

Presumably, setting the length to negative number fails, and then execution halts, so we never get to the test (this.kittens.length was 35; amount was 49). Using the console to change the function first check if this.kittens.length - amount < 0 fixed it.

Also, incidentally, all my kittens died, and when I got one back, the "Small Village" tab didn't show up - I had to save and reload to get it back.

Comments (1)

  1. Log in to comment