Commit 5e7cb088 authored by Terence Martin's avatar Terence Martin

Fix drop ball bug introduced yesterday

Yesterday I introduced some new code where we could detect a vanished
ball but not trigger the notification that a ball drop was complete if
the ball was being vanished due to it being a blocked ball.

This was a bit flawed but unfortunatey I didn't notice it until it was
too late. Basically it would not trigger for a ball that vanished
because it got to the goal, because I used the wrong variable to track
if the event should trigger or not (_droppedBall instead of
_lastDroppedBall) and since _droppedBall gets cleared as soon as the
vanish is called, such a ball is treated like a blocked ball.

This has been fixed by using the correct variable.
parent f3d4974f
......@@ -4376,7 +4376,7 @@ var nurdz;
// This also gets triggered during non-dropped ball removal, such
// as vanishing blocked balls, but in that case we don't set the
// flag because the appropriate handling has already been done.
if (this.clearHiddenBalls() > 0 && this._droppingBall != null)
if (this.clearHiddenBalls() > 0 && this._lastDroppedBall != null)
this._ballMoveFinalized = true;
// Reap any dead gray bricks; these are the gray bricks that have
// been vanished out of the level because all of the balls have been
......
......@@ -991,7 +991,7 @@ module nurdz.game
// This also gets triggered during non-dropped ball removal, such
// as vanishing blocked balls, but in that case we don't set the
// flag because the appropriate handling has already been done.
if (this.clearHiddenBalls () > 0 && this._droppingBall != null)
if (this.clearHiddenBalls () > 0 && this._lastDroppedBall != null)
this._ballMoveFinalized = true;
// Reap any dead gray bricks; these are the gray bricks that have
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment