summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2009-04-02 13:07:02 +0200
committerBjørn Lindeijer <bjorn@lindeijer.nl>2009-04-02 13:19:28 +0200
commit42c63de10f16c7d12955b653fc2e3a7743799551 (patch)
tree9951fd0c681c4fe95bbf54c24fb7f243bc92302a
parenta48c48ab6d245697928f8ddb64e9da0a2ab5da1b (diff)
downloadmana-42c63de10f16c7d12955b653fc2e3a7743799551.tar.gz
mana-42c63de10f16c7d12955b653fc2e3a7743799551.tar.bz2
mana-42c63de10f16c7d12955b653fc2e3a7743799551.tar.xz
mana-42c63de10f16c7d12955b653fc2e3a7743799551.zip
Removed duplicated code in LocalPlayer
This code was present in both Player and LocalPlayer. If there's some kind of issue with executing this stuff in a different order, it should be solved differently.
-rw-r--r--src/localplayer.cpp61
-rw-r--r--src/player.cpp8
2 files changed, 1 insertions, 68 deletions
diff --git a/src/localplayer.cpp b/src/localplayer.cpp
index f59b5f05..7dc9ec43 100644
--- a/src/localplayer.cpp
+++ b/src/localplayer.cpp
@@ -150,65 +150,6 @@ LocalPlayer::~LocalPlayer()
void LocalPlayer::logic()
{
-#ifdef EATHENA_SUPPORT
- switch (mAction)
- {
- case STAND:
- break;
-
- case SIT:
- break;
-
- case DEAD:
- break;
-
- case HURT:
- break;
-
- case WALK:
- mFrame = (get_elapsed_time(mWalkTime) * 6) / getWalkSpeed();
- if (mFrame >= 6)
- nextStep();
- break;
-
- case ATTACK:
- int rotation = 0;
- std::string particleEffect = "";
- int frames = 4;
-
- if (mEquippedWeapon &&
- mEquippedWeapon->getAttackType() == ACTION_ATTACK_BOW)
- frames = 5;
-
- mFrame = (get_elapsed_time(mWalkTime) * frames) / mAttackSpeed;
-
- //attack particle effect
- if (mEquippedWeapon)
- particleEffect = mEquippedWeapon->getParticleEffect();
-
- if (!particleEffect.empty() && mParticleEffects && mFrame == 1)
- {
- switch (mDirection)
- {
- case DOWN: rotation = 0; break;
- case LEFT: rotation = 90; break;
- case UP: rotation = 180; break;
- case RIGHT: rotation = 270; break;
- default: break;
- }
- Particle *p;
- p = particleEngine->addEffect("graphics/particles/" +
- particleEffect, 0, 0, rotation);
- controlParticle(p);
- }
-
- if (mFrame >= frames)
- nextStep();
-
- break;
- }
-#endif
-
// Actions are allowed once per second
if (get_elapsed_time(mLastAction) >= 1000)
mLastAction = -1;
@@ -275,7 +216,7 @@ void LocalPlayer::logic()
}
#endif
- Being::logic();
+ Player::logic();
}
void LocalPlayer::setGM()
diff --git a/src/player.cpp b/src/player.cpp
index 839959b0..e1dc3806 100644
--- a/src/player.cpp
+++ b/src/player.cpp
@@ -82,23 +82,15 @@ void Player::logic()
switch (mAction)
{
case STAND:
- break;
-
case SIT:
- break;
-
case DEAD:
- break;
-
case HURT:
break;
case WALK:
mFrame = (get_elapsed_time(mWalkTime) * 6) / getWalkSpeed();
-
if (mFrame >= 6)
nextStep();
-
break;
case ATTACK: