From 172efa6ba57bca0abd1f0c2cd96d3a5920f6bcef Mon Sep 17 00:00:00 2001 From: Mathieu Schroeter Date: Wed, 9 Aug 2017 00:22:49 +0200 Subject: [PATCH] Fix a bug where it possibles to take the control of an enemy This bug was reported by https://youtu.be/MyWZj20-Iok?t=9m The idea is to enter in the enemy factory when it should not be possible because the enemy is already into. --- src/obstacle.cxx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/obstacle.cxx b/src/obstacle.cxx index 584efa0..ccb266e 100644 --- a/src/obstacle.cxx +++ b/src/obstacle.cxx @@ -1750,6 +1750,12 @@ bool CDecor::IsFreeCelGo (POINT cel, Sint32 rank) icon == 122)) // mine de fer ? return false; + // Refuse to go in an ennemy factory when the door is open. + if ( + channel == CHOBJECT && + (icon == 18 || icon == 101 || icon == 103 || icon == 105 || icon == 116)) + return false; + bOK = IsFreeCel (cel, rank); if (bOK) return true;