From: Holger Schemel Date: Fri, 7 May 2021 15:08:16 +0000 (+0200) Subject: moved some expressions for "autotest" result to separate variables X-Git-Tag: 4.3.0.0~159 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=4367e9865c06b77f4fffb484c87647eecc3c2eb5;p=rocksndiamonds.git moved some expressions for "autotest" result to separate variables --- diff --git a/src/tape.c b/src/tape.c index 6f424b12..1aeeb253 100644 --- a/src/tape.c +++ b/src/tape.c @@ -1495,6 +1495,11 @@ void AutoPlayTapes(void) return; } + char *autoplay_status = (num_levels_played == num_levels_solved && + num_levels_played > 0 ? " OK " : "WARN"); + int autoplay_percent = (num_levels_played ? + num_levels_solved * 100 / num_levels_played : 0); + Print("\n"); PrintLine("=", 79); Print("Number of levels played: %d\n", num_levels_played); @@ -1505,10 +1510,11 @@ void AutoPlayTapes(void) PrintLine("-", 79); Print("Summary (for automatic parsing by scripts):\n"); Print("LEVELDIR [%s] '%s', SOLVED %d/%d (%d%%)", - (num_levels_played == num_levels_solved && - num_levels_played > 0 ? " OK " : "WARN"), - autoplay_leveldir->identifier, num_levels_solved, num_levels_played, - (num_levels_played ? num_levels_solved * 100 / num_levels_played : 0)); + autoplay_status, + autoplay_leveldir->identifier, + num_levels_solved, + num_levels_played, + autoplay_percent); if (num_levels_played != num_levels_solved) {