From f26d6b3c247a673b990fcb1ad5b45ef2fd55d3d9 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Wed, 29 May 2019 13:27:55 +0200 Subject: [PATCH] Preventing Phsae to Attach to Stop or Take Profit with maxPhases --- FloatingSpace/StrategyPart.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/FloatingSpace/StrategyPart.js b/FloatingSpace/StrategyPart.js index 6c9f03faa..961705418 100644 --- a/FloatingSpace/StrategyPart.js +++ b/FloatingSpace/StrategyPart.js @@ -279,6 +279,14 @@ function newStrategyPart () { if (thisObject.payload.node.type === 'Code' && nearbyNode.code !== undefined) { continue } /* Discard Phases without partent */ if (thisObject.payload.node.type === 'Phase' && nearbyNode.type === 'Phase' && nearbyNode.payload.parentNode === undefined) { continue } + /* Control maxPhases */ + if (thisObject.payload.node.type === 'Phase') { + if (nearbyNode.maxPhases !== undefined) { + if (nearbyNode.phases.length >= nearbyNode.maxPhases) { + continue + } + } + } if (foundCompatible === false) { if (distance < thisObject.container.frame.radius * 1.5 + floatingObject.container.frame.radius * 1.5) { nearbyNode.payload.uiObject.getReadyToAttach()