From 7ef586926e86b7f85eecb71c65577eb782800f93 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Tue, 14 Jan 2014 22:35:22 +0100 Subject: [PATCH] Handle fali-low & fail high A ? or ! at the end of the PV are now also written behind the score. --- engineoutput.c | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/engineoutput.c b/engineoutput.c index aae73ca..af121d6 100644 --- a/engineoutput.c +++ b/engineoutput.c @@ -545,7 +545,7 @@ UpdateControls (EngineOutputData *ed) char s_hits[24]; char s_seld[24]; char s_knps[24]; - char buf[256], *pvStart = ed->pv; + char buf[256], *pvStart = ed->pv, fail; int buflen, hits, seldep, knps, extra; int time_secs = ed->time / 100; int time_cent = ed->time % 100; @@ -567,17 +567,19 @@ UpdateControls (EngineOutputData *ed) if(extra) { // strip extended info from PV if((pvStart = strstr(ed->pv, "} "))) pvStart += 2; else pvStart = ed->pv; } + fail = ed->pv[strlen(ed->pv)-1]; + if(fail != '?' && fail != '!') fail = ' '; /* Score */ h = ((gameMode == AnalyzeMode && appData.whitePOV || appData.scoreWhite) && !WhiteOnMove(currentMove) ? -1 : 1) * ed->score; if( h == 0 ) { - snprintf( s_score, sizeof(s_score)/sizeof(s_score[0]), " 0.00\t" ); + snprintf( s_score, sizeof(s_score)/sizeof(s_score[0]), " 0.00%c\t", fail ); } else if( h > 0 ) { - snprintf( s_score, sizeof(s_score)/sizeof(s_score[0]), "+%.2f\t", h / 100.0 ); + snprintf( s_score, sizeof(s_score)/sizeof(s_score[0]), "+%.2f%c\t", h / 100.0, fail ); } else { - snprintf( s_score, sizeof(s_score)/sizeof(s_score[0]), " %.2f\t", h / 100.0 ); + snprintf( s_score, sizeof(s_score)/sizeof(s_score[0]), " %.2f%c\t", h / 100.0, fail ); } /* Time */ -- 1.7.0.4