From b5f457161841593bc384fb843c154659755360db Mon Sep 17 00:00:00 2001 From: Blake Harnden <32446120+bharnden@users.noreply.github.com> Date: Thu, 23 Apr 2020 10:26:12 -0700 Subject: [PATCH] fixed edit node using a 0,0 position when not intending to move node, side effect of trying to give new nodes a default position --- daemon/core/emulator/session.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/daemon/core/emulator/session.py b/daemon/core/emulator/session.py index 80538fc3..7d1d3228 100644 --- a/daemon/core/emulator/session.py +++ b/daemon/core/emulator/session.py @@ -695,6 +695,7 @@ class Session: # generate name if not provided if not options: options = NodeOptions() + options.set_position(0, 0) name = options.name if not name: name = f"{node_class.__name__}{_id}" @@ -809,9 +810,7 @@ class Session: node.setposition(x, y, None) node.position.set_geo(lon, lat, alt) self.broadcast_node(node) - else: - if has_empty_position: - x, y = 0, 0 + elif not has_empty_position: node.setposition(x, y, None) def start_mobility(self, node_ids: List[int] = None) -> None: