Preventing Phsae to Attach to Stop or Take Profit with maxPhases

This commit is contained in:
Luis Fernando Molina committed 2019-05-29 13:27:55 +02:00
1 parent 27f312df42
commit f26d6b3c24
1 file changed
+8
+8
View File
@@ -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()