summaryrefslogtreecommitdiffstats
path: root/examples/statemachine/tankgameplugins/spin_ai/spin_ai.h
diff options
context:
space:
mode:
Diffstat (limited to 'examples/statemachine/tankgameplugins/spin_ai/spin_ai.h')
-rw-r--r--examples/statemachine/tankgameplugins/spin_ai/spin_ai.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/examples/statemachine/tankgameplugins/spin_ai/spin_ai.h b/examples/statemachine/tankgameplugins/spin_ai/spin_ai.h
index a331a3e..d8d3d73 100644
--- a/examples/statemachine/tankgameplugins/spin_ai/spin_ai.h
+++ b/examples/statemachine/tankgameplugins/spin_ai/spin_ai.h
@@ -18,7 +18,7 @@ public:
public slots:
void spin()
{
- m_tank->setProperty("direction", 90.0);
+ m_tank->setProperty("direction", m_tank->property("direction").toDouble() + 90.0);
}
protected:
@@ -28,6 +28,11 @@ protected:
spin();
}
+ void onExit(QEvent *)
+ {
+ disconnect(m_tank, SIGNAL(actionCompleted()), this, SLOT(spin()));
+ }
+
private:
QObject *m_tank;