From d388730da773c46f228894186c29d330a774b72b Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Tue, 5 May 2009 13:48:24 +0200 Subject: Fix support reverse actions. Logic was broken and would always return false immediately for reverse actions, thus immediately stopping them. --- examples/statemachine/errorstate/tankitem.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/statemachine/errorstate/tankitem.cpp b/examples/statemachine/errorstate/tankitem.cpp index 1e02171..fc71ef9 100644 --- a/examples/statemachine/errorstate/tankitem.cpp +++ b/examples/statemachine/errorstate/tankitem.cpp @@ -41,7 +41,7 @@ public: m_distance -= dist; if (m_reverse && m_distance > 0.0) return false; - else if (m_distance < 0.0) + else if (!m_reverse && m_distance < 0.0) return false; qreal a = item()->direction() * M_PI / 180.0; @@ -73,7 +73,7 @@ public: m_distance -= dist; if (m_reverse && m_distance > 0.0) return false; - else if (m_distance < 0.0) + else if (!m_reverse && m_distance < 0.0) return false; item()->setDirection(item()->direction() + dist); -- cgit v0.12