- let evalPos = undefined;
- if (this.atLeastOneMove())
- evalPos = this.evalPosition()
- else
- {
- // Working with scores is more accurate (necessary for Loser variant)
- const score = this.checkGameEnd();
- evalPos = (score=="1/2" ? 0 : (score=="1-0" ? 1 : -1) * maxeval);
- }
+ const score2 = this.getCurrentScore();
+ const evalPos = score2 == "*"
+ ? this.evalPosition()
+ : (score2=="1/2" ? 0 : (score2=="1-0" ? 1 : -1) * maxeval);