From ffe173bdc8d701a8afe18310d4be734835a6b1e7 Mon Sep 17 00:00:00 2001 From: "Egli Adrian (IT-SCI-API-PFI)" <adrian.egli@sbb.ch> Date: Tue, 4 Jun 2019 21:50:27 +0200 Subject: [PATCH] ctrl + click bug fixed. we can move selected agent --- flatland/utils/editor.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/flatland/utils/editor.py b/flatland/utils/editor.py index 2adbf6bc..eee17415 100644 --- a/flatland/utils/editor.py +++ b/flatland/utils/editor.py @@ -743,6 +743,8 @@ class EditorModel(object): # Has the user clicked on an existing agent? iAgent = self.find_agent_at(rcCell) + print("sel:", iAgent, self.iSelectedAgent) + if iAgent is None: # No if self.iSelectedAgent is None: @@ -754,6 +756,8 @@ class EditorModel(object): # Move the selected agent to this cell agent_static = self.env.agents_static[self.iSelectedAgent] agent_static.position = rcCell + agent_static.old_position = rcCell + self.env.agents = [] else: # Yes # Have they clicked on the agent already selected? -- GitLab