Skip to content

Commit

Permalink
fix color-to-play detection for problem mode
Browse files Browse the repository at this point in the history
  • Loading branch information
jkk committed Sep 12, 2008
1 parent bc9c23d commit be1f959
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions player/js/all.compressed.js
Original file line number Diff line number Diff line change
Expand Up @@ -1272,7 +1272,7 @@ this.searching=false;
this.editingText=false;
this.goingBack=false;
this.problemMode=cfg.problemMode;
this.problemColor=cfg.problemColor||"B";
this.problemColor=cfg.problemColor;
this.prefs={};
this.prefs.markCurrent=typeof cfg.markCurrent!="undefined"?!!cfg.markCurrent:true;
this.prefs.markNext=typeof cfg.markNext!="undefined"?cfg.markNext:false;
Expand Down Expand Up @@ -1366,9 +1366,9 @@ this.loadPath=[0,0];
}else{
this.refresh();
}
if(!_1f._parent&&this.problemMode){
if(_20&&this.problemMode){
if(!this.problemColor){
this.currentColor=this.problemColor=this.cursor.getNextColor();
this.currentColor=this.problemColor=(this.cursor.getNextColor()||"B");
}else{
this.currentColor=this.problemColor;
}
Expand Down
6 changes: 3 additions & 3 deletions player/js/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ eidogo.Player.prototype = {

// problem-solving mode: respond when the user plays a move
this.problemMode = cfg.problemMode;
this.problemColor = cfg.problemColor || "B";
this.problemColor = cfg.problemColor;

// user-changeable preferences
this.prefs = {};
Expand Down Expand Up @@ -462,9 +462,9 @@ eidogo.Player.prototype = {
}

// find out which color to play as for problem mode
if (!target._parent && this.problemMode) {
if (newGame && this.problemMode) {
if (!this.problemColor)
this.currentColor = this.problemColor = this.cursor.getNextColor();
this.currentColor = this.problemColor = (this.cursor.getNextColor() || "B");
else
this.currentColor = this.problemColor;
}
Expand Down

0 comments on commit be1f959

Please sign in to comment.