Allow self-destruct using logic node
This commit is contained in:
parent
ea57b9cd40
commit
e65b6d119a
|
@ -11,8 +11,9 @@ class RemoveObjectNode extends LogicNode {
|
|||
override function run() {
|
||||
var object:Object = inputs[1].get();
|
||||
|
||||
// Prevent self-destruct
|
||||
if (object != null && object != tree.object) object.remove();
|
||||
if (object == null) object = tree.object;
|
||||
|
||||
object.remove();
|
||||
|
||||
super.run();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue