summaryrefslogtreecommitdiffstats
path: root/examples/statemachine/tankgameplugins/spin_ai/spin_ai.h
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eblomfel@trolltech.com>2009-05-14 08:33:05 (GMT)
committerEskil Abrahamsen Blomfeldt <eblomfel@trolltech.com>2009-05-14 08:33:05 (GMT)
commit66d8ad206cca48d8193785bdf685f5d1fba80f02 (patch)
tree5c5e4cf555b1586c93d9ed7f87d05bdb557c0db6 /examples/statemachine/tankgameplugins/spin_ai/spin_ai.h
parent3cd4b6e00e3448d880ae2335bd50f70d9a5d0fca (diff)
downloadQt-66d8ad206cca48d8193785bdf685f5d1fba80f02.zip
Qt-66d8ad206cca48d8193785bdf685f5d1fba80f02.tar.gz
Qt-66d8ad206cca48d8193785bdf685f5d1fba80f02.tar.bz2
Fix SpinState in Tank Game Example to spin more than 180 degrees
This was a leftover from when the setDirection() semantics were broken.
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;