From fa4d396635478dff0dccc1540d9bf725fc794764 Mon Sep 17 00:00:00 2001
From: "Egli Adrian (IT-SCI-API-PFI)" <adrian.egli@sbb.ch>
Date: Thu, 23 May 2019 11:29:03 +0200
Subject: [PATCH] =?UTF-8?q?@Rednering:=20TODO=3D=3F?=

---
 flatland/utils/render_qt.py   |  1 -
 flatland/utils/rendertools.py | 16 +++++++++++-----
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/flatland/utils/render_qt.py b/flatland/utils/render_qt.py
index 60e147d0..0f3a0f89 100644
--- a/flatland/utils/render_qt.py
+++ b/flatland/utils/render_qt.py
@@ -218,7 +218,6 @@ class QTSVG(GraphicsLayer):
         self.lwAgents[iAgent] = svgWidget
         self.agents_prev[iAgent] = EnvAgent((row, col), iDirOut, (0, 0), old_direction=iDirIn)
         self.layout.addWidget(svgWidget, row, col)
-        # print("Created ", iAgent, row, col)
 
     def show(self, block=False):
         self.wMain.update()
diff --git a/flatland/utils/rendertools.py b/flatland/utils/rendertools.py
index a0398f25..d17bbef8 100644
--- a/flatland/utils/rendertools.py
+++ b/flatland/utils/rendertools.py
@@ -764,12 +764,18 @@ class RenderTool(object):
                 iAction = action_dict[iAgent]
                 new_direction, action_isValid = self.env.check_action(agent, iAction)
 
-            if action_isValid:
-                self.gl.setAgentAt(iAgent, *agent.position, agent.direction, new_direction, color=oColor)
+
+            # ** TODO ***
+            # why should we only update if the action is valid ?
+            if False:
+                if action_isValid:
+                    self.gl.setAgentAt(iAgent, *agent.position, agent.direction, new_direction, color=oColor)
+                else:
+                    pass
+                    # print("invalid action - agent ", iAgent, " bend ", agent.direction, new_direction)
+                    # self.gl.setAgentAt(iAgent, *agent.position, agent.direction, new_direction)
             else:
-                pass
-                # print("invalid action - agent ", iAgent, " bend ", agent.direction, new_direction)
-                # self.gl.setAgentAt(iAgent, *agent.position, agent.direction, new_direction)
+                self.gl.setAgentAt(iAgent, *agent.position, agent.direction, new_direction, color=oColor)
 
         self.gl.show()
         for i in range(3):
-- 
GitLab