Closed pllsner closed 8 years ago
Huh ?
the value 2 disabled any acceleration of worm in my test. This wiki is reporting wrong results from the code change.
What page of the wiki ?
reinstalled resource override. reran the test. a value of 2 disables any acceleration. Left mouse click does not accelerate.
@pllsner weren't you the one who got that working on the first place?
I copy+pasted that wiki page from your issue #274
Oh you mean the wiki is incorrect. Why don't you edit the wiki to be correct then? I thought I was clarifying things but probably got it wrong.
i was not aware I could edit the wiki, or i would have. :)
So in your test, 2 was the same as 1? Or was 2 the same as 0?
2 is an odd number to use anyway, since it's not normally a valid value.
If you had set acceleration to 1, then it would always be enabled, right?
2 was the same as 0. The logic in the function became false. original: function setAcceleration(b) { null != snake && (snake.wmd = 1 == b)} altered: function setAcceleration(b) { null != snake && (snake.wmd = 2 == b)} Given that b = 1 or 0, (the only values passed to this function) the table below explains the comparison operator == : original function: Operator..................Description...............Comparing............or.........Returns ....==.........................equal to.....................1 == b.............1 == 0.......false ..........................................................................................1 == 1........true altered function: Operator..................Description...............Comparing............or.........Returns ....==.........................equal to.....................2 == b.............2 == 0.......false ..........................................................................................2 == 1.......false by calling this altered function with setAcceleration(0), or setAcceleration(1), the condition is always false, so no acceleration ever occurs. .....update . modifying the function appears to disable any acceleration.
Oh, I see. :+1: Well feel free to edit this wiki and close the issue when fixed.
Oops wrong button lol.
I tested out this extension by hard-coding acceleration to always be enabled. Test was a success -- Left mouse clicks did not cause any speed change (always accelerated). Should read......... I tested out this extension by hard-coding acceleration to always be disabled. Test was a success -- Left mouse clicks did not cause any speed change (never accelerated).