score sign in analysis mode
authorH.G. Muller <h.g.muller@hccnet.nl>
Sat, 28 Nov 2009 21:27:43 +0000 (13:27 -0800)
committerArun Persaud <arun@nubati.net>
Sat, 28 Nov 2009 21:27:43 +0000 (13:27 -0800)
this does not alter any of the current behavior with compliant engines,
but does extend the correction for non-compliant score reporting under
control of the -first(second)ScoreIsAbs option to cases where the engine
is analyzing or playing on an ICS.

backend.c

index 9a95466..c2dea7c 100755 (executable)
--- a/backend.c
+++ b/backend.c
@@ -6924,7 +6924,12 @@ if(appData.debugMode) fprintf(debugFP, "nodes = %d, %lld\n", (int) programStats.
 
                 /* [AS] Negate score if machine is playing black and reporting absolute scores */
                 if( cps->scoreIsAbsolute && 
-                    ((gameMode == MachinePlaysBlack) || (gameMode == TwoMachinesPlay && cps->twoMachinesColor[0] == 'b')) )
+                    ( gameMode == MachinePlaysBlack ||
+                      gameMode == TwoMachinesPlay && cps->twoMachinesColor[0] == 'b' ||
+                      gameMode == IcsPlayingBlack ||     // [HGM] also add other situations where engine should report black POV
+                     (gameMode == AnalyzeMode || gameMode == AnalyzeFile || gameMode == IcsObserving && appData.icsEngineAnalyze) &&
+                     !WhiteOnMove(currentMove)
+                    ) )
                 {
                     curscore = -curscore;
                 }