From e8a9976222bce0dd12a0d8ec1aad176aaee5cd94 Mon Sep 17 00:00:00 2001 From: PF Date: Tue, 23 May 2017 15:47:40 +0200 Subject: [PATCH] =?UTF-8?q?Bugfix=20d=C3=A9sactivation=20obstacles?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc/src/pathfinding/astar/arcs/ArcManager.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pc/src/pathfinding/astar/arcs/ArcManager.java b/pc/src/pathfinding/astar/arcs/ArcManager.java index f3dd63b2..b5634a4c 100644 --- a/pc/src/pathfinding/astar/arcs/ArcManager.java +++ b/pc/src/pathfinding/astar/arcs/ArcManager.java @@ -384,18 +384,24 @@ public void disableObstaclesFixes(boolean symetrie, CinematiqueObs obs) { disabledObstaclesFixes.clear(); ObstaclesFixes depart; + boolean vide = true; if(symetrie) depart = ObstaclesFixes.ZONE_DEPART_GAUCHE_CENTRE; else depart = ObstaclesFixes.ZONE_DEPART_DROITE_CENTRE; - disabledObstaclesFixes.add(depart); + for(ObstaclesFixes o : ObstaclesFixes.values()) if(!o.bordure && o.getObstacle().isColliding(obs.obstacle)) { + vide = false; log.warning("Désactivation de l'obstacle fixe : " + o + ". Obs : " + obs); disabledObstaclesFixes.add(o); } - if(!disabledObstaclesFixes.isEmpty()) + + if(!disabledObstaclesFixes.contains(depart)) + disabledObstaclesFixes.add(depart); + + if(!vide) dstarlite.disableObstaclesFixes(obs.getPosition(), depart.getObstacle()); else dstarlite.disableObstaclesFixes(null, depart.getObstacle());