summaryrefslogtreecommitdiff
path: root/src/localplayer.cpp
diff options
context:
space:
mode:
authorGuillaume Melquiond <guillaume.melquiond@gmail.com>2006-08-27 16:23:36 +0000
committerGuillaume Melquiond <guillaume.melquiond@gmail.com>2006-08-27 16:23:36 +0000
commit1554a6749f2dbcd9b44aae1df3e320a06b049d4f (patch)
tree08efd4ca4dc8a81bb53894d138cf702fd1d40c55 /src/localplayer.cpp
parent8ca48faeb472bb6645ec18c7b2e0480e8e20435e (diff)
downloadmana-1554a6749f2dbcd9b44aae1df3e320a06b049d4f.tar.gz
mana-1554a6749f2dbcd9b44aae1df3e320a06b049d4f.tar.bz2
mana-1554a6749f2dbcd9b44aae1df3e320a06b049d4f.tar.xz
mana-1554a6749f2dbcd9b44aae1df3e320a06b049d4f.zip
Cleaned the logic members.
Diffstat (limited to 'src/localplayer.cpp')
-rw-r--r--src/localplayer.cpp18
1 files changed, 3 insertions, 15 deletions
diff --git a/src/localplayer.cpp b/src/localplayer.cpp
index 74924b1d..368bc8e3 100644
--- a/src/localplayer.cpp
+++ b/src/localplayer.cpp
@@ -52,21 +52,9 @@ LocalPlayer::~LocalPlayer()
void LocalPlayer::logic()
{
- switch (mAction) {
- case WALK:
- if (get_elapsed_time(mWalkTime) >= mWalkSpeed)
- {
- nextStep();
- }
- break;
-
- case ATTACK:
- if (get_elapsed_time(mWalkTime) >= mAttackSpeed)
- {
- nextStep();
- attack();
- }
- break;
+ if (mAction == ATTACK && get_elapsed_time(mWalkTime) >= mAttackSpeed)
+ {
+ attack();
}
// Actions are allowed once per second