Commit c3da8655 authored by Terence Martin's avatar Terence Martin

Fix final ball drop bug

It turns out that the reason for this failure was entirely because I
incorrectly stopped the search for balls to remove for being vanished
one column short of the edge.

This means that any final ball dropped in the last column of the maze
will vanish but not be reaped. Thus the flag for the ball being done
will never get set and everything stalls out.

Whoops.
parent d4a3f817
......@@ -4184,7 +4184,7 @@ var nurdz;
Maze.prototype.clearHiddenBalls = function () {
var retVal = 0;
for (var row = 0; row < game.MAZE_HEIGHT - 1; row++) {
for (var col = 1; col < game.MAZE_WIDTH - 2; col++) {
for (var col = 1; col < game.MAZE_WIDTH - 1; col++) {
var ball = this._contents.getCellAt(col, row);
if (ball != null && ball.name == "ball" && ball.isHidden) {
this._contents.clearCellAt(col, row);
......
......@@ -752,7 +752,7 @@ module nurdz.game
for (let row = 0 ; row < MAZE_HEIGHT - 1 ; row++)
{
for (let col = 1 ; col < MAZE_WIDTH - 2 ; col++)
for (let col = 1 ; col < MAZE_WIDTH - 1 ; col++)
{
let ball = <Ball> this._contents.getCellAt (col, row);
if (ball != null && ball.name == "ball" && ball.isHidden)
......
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