From 8a9849c27e12d4f993ed9d0702a45ce607fde788 Mon Sep 17 00:00:00 2001 From: Mathieu Schroeter Date: Fri, 22 Sep 2017 12:18:45 +0200 Subject: [PATCH] Hide enemies from the map (with fog) with the difficult skill level It's the first step for resolving issue #22. --- src/decmap.cxx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/decmap.cxx b/src/decmap.cxx index 28147a3..253e144 100644 --- a/src/decmap.cxx +++ b/src/decmap.cxx @@ -533,6 +533,16 @@ CDecor::GenerateMap () if (m_blupi[rank].bExist) { pos = ConvCelToMap (m_blupi[rank].cel); + + if (this->GetSkill () >= 1 && !m_bBuild) + { + 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 ( pos.x >= 0 && pos.x < DIMMAPX - 1 && pos.y >= 0 && pos.y < DIMMAPY - 1) {