From d47108c3aa23a3f12f05a54b1e3a43eacf87af47 Mon Sep 17 00:00:00 2001 From: Mathieu Schroeter Date: Fri, 6 Oct 2017 18:11:24 +0200 Subject: [PATCH] Fix regression with difficult skill level The IsTerminated() stuff is based on the statistics. In the case of the difficult skill level, only the table must be adapted, not the counters. The counters are used by the check for the ending conditions. --- src/decstat.cxx | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/decstat.cxx b/src/decstat.cxx index 1d77e87..89fafab 100644 --- a/src/decstat.cxx +++ b/src/decstat.cxx @@ -474,18 +474,20 @@ CDecor::StatisticUpdate () table_statistic[STATDISCIPLE].nb++; // Hide enemies from the stat when hidden by the fog + bool hide = false; if (this->GetSkill () >= 1) { auto fogCel = m_blupi[rank].cel; fogCel.x = (fogCel.x / 4) * 4; fogCel.y = (fogCel.y / 4) * 4; if (m_decor[fogCel.x / 2][fogCel.y / 2].fog == FOGHIDE) // hidden? - continue; + hide = true; } if (m_blupi[rank].perso == 4) // robot ? { - table_statistic[STATROBOT].nb++; + if (!hide) + table_statistic[STATROBOT].nb++; m_nbStatRobots++; x = (m_blupi[rank].cel.x / 2) * 2; y = (m_blupi[rank].cel.y / 2) * 2; @@ -496,27 +498,32 @@ CDecor::StatisticUpdate () } if (m_blupi[rank].perso == 3) // tracks ? { - table_statistic[STATTRACKS].nb++; + if (!hide) + table_statistic[STATTRACKS].nb++; if (!m_term.bHachRobot) // pas robot sur hachures ? m_nbStatRobots++; } if (m_blupi[rank].perso == 1) // araignée ? { - table_statistic[STATARAIGNEE].nb++; + if (!hide) + table_statistic[STATARAIGNEE].nb++; if (!m_term.bHachRobot) // pas robot sur hachures ? m_nbStatRobots++; } if (m_blupi[rank].perso == 2) // virus ? - table_statistic[STATVIRUS].nb++; + if (!hide) + table_statistic[STATVIRUS].nb++; if (m_blupi[rank].perso == 5) // bombe ? { - table_statistic[STATBOMBE].nb++; + if (!hide) + table_statistic[STATBOMBE].nb++; if (!m_term.bHachRobot) // pas robot sur hachures ? m_nbStatRobots++; } if (m_blupi[rank].perso == 7) // électro ? { - table_statistic[STATELECTRO].nb++; + if (!hide) + table_statistic[STATELECTRO].nb++; if (!m_term.bHachRobot) // pas robot sur hachures ? m_nbStatRobots++; }