From 5c31ece4a376df80d92eb36cc5ff05efaa16d796 Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Sun, 9 Dec 2018 11:03:54 +1200 Subject: Improved he behaviour of P/X --- desktop/core/library/p.js | 3 ++- desktop/core/library/x.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/desktop/core/library/p.js b/desktop/core/library/p.js index f490303..c7760a2 100644 --- a/desktop/core/library/p.js +++ b/desktop/core/library/p.js @@ -3,7 +3,7 @@ const Operator = require('../operator') function OperatorP (orca, x, y, passive) { - Operator.call(this, orca, x, y, 'p', passive) + Operator.call(this, orca, x, y, 'p', true) this.name = 'push' this.info = 'Writes an eastward operator with offset.' @@ -23,6 +23,7 @@ function OperatorP (orca, x, y, passive) { } this.run = function () { + if (!this.bang() && !passive) { return } const res = this.listen(this.ports.input.val) this.output(`${res}`) } diff --git a/desktop/core/library/x.js b/desktop/core/library/x.js index 9449461..f2ffcd9 100644 --- a/desktop/core/library/x.js +++ b/desktop/core/library/x.js @@ -3,7 +3,7 @@ const Operator = require('../operator') function OperatorX (orca, x, y, passive) { - Operator.call(this, orca, x, y, 'x', passive) + Operator.call(this, orca, x, y, 'x', true) this.name = 'teleport' this.info = 'Writes a distant operator with offset.' @@ -20,6 +20,7 @@ function OperatorX (orca, x, y, passive) { } this.run = function () { + if (!this.bang() && !passive) { return } const res = this.listen(this.ports.input.val) this.output(`${res}`) } -- cgit v1.2.3