From 74ba9ea8f8d1063f31f30a621b919256d6f03a9d Mon Sep 17 00:00:00 2001 From: Mathieu Schroeter Date: Fri, 22 Sep 2017 12:44:07 +0200 Subject: [PATCH] Hide enemies (under fog) from stat with the difficult skill level It concerns issue #22. --- src/decstat.cxx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/decstat.cxx b/src/decstat.cxx index 5ed69da..a5d69d3 100644 --- a/src/decstat.cxx +++ b/src/decstat.cxx @@ -472,6 +472,17 @@ CDecor::StatisticUpdate () } if (m_blupi[rank].perso == 8) // disciple ? table_statistic[STATDISCIPLE].nb++; + + // Hide enemies from the stat when hidden by the fog + 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; + } + if (m_blupi[rank].perso == 4) // robot ? { table_statistic[STATROBOT].nb++;