summaryrefslogtreecommitdiff
path: root/src/player.cpp
diff options
context:
space:
mode:
authorDaniel Bradshaw <daniel+commits@the-cell.co.uk>2010-01-31 13:14:07 +0000
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2010-01-31 17:50:29 +0100
commit2ff6ad2e8a67bd8ef34b56b866ef277c30135f19 (patch)
tree536497f63044441a6e8032209446d1c3213b9d55 /src/player.cpp
parent22c75a346e029fad746b6aa0b123c886ddeb5c75 (diff)
downloadmana-2ff6ad2e8a67bd8ef34b56b866ef277c30135f19.tar.gz
mana-2ff6ad2e8a67bd8ef34b56b866ef277c30135f19.tar.bz2
mana-2ff6ad2e8a67bd8ef34b56b866ef277c30135f19.tar.xz
mana-2ff6ad2e8a67bd8ef34b56b866ef277c30135f19.zip
Unify eAthena and manaserv support in to one build.
Finish support for server types in the server dialog. Using the new server type function, strip out ifdefs, replacing them with if blocks for later merging in smaller atomic commits. Remove any remaining references to the support defs, including in build system.
Diffstat (limited to 'src/player.cpp')
-rw-r--r--src/player.cpp97
1 files changed, 49 insertions, 48 deletions
diff --git a/src/player.cpp b/src/player.cpp
index 007a398c..022b06ba 100644
--- a/src/player.cpp
+++ b/src/player.cpp
@@ -73,60 +73,61 @@ Player::~Player()
void Player::logic()
{
-#ifdef EATHENA_SUPPORT
- switch (mAction)
+ if (Net::getNetworkType() == ServerInfo::EATHENA)
{
- case STAND:
- case SIT:
- case DEAD:
- case HURT:
- break;
-
- case WALK:
- mFrame = (int) ((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() && Particle::enabled && mFrame == 1)
- {
- switch (mDirection)
+ switch (mAction)
+ {
+ case STAND:
+ case SIT:
+ case DEAD:
+ case HURT:
+ break;
+
+ case WALK:
+ mFrame = (int) ((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)
{
- case DOWN: rotation = 0; break;
- case LEFT: rotation = 90; break;
- case UP: rotation = 180; break;
- case RIGHT: rotation = 270; break;
- default: break;
+ frames = 5;
}
- Particle *p;
- p = particleEngine->addEffect("graphics/particles/" +
- particleEffect, 0, 0, rotation);
- controlParticle(p);
- }
- if (mFrame >= frames)
- nextStep();
+ mFrame = (get_elapsed_time(mWalkTime) * frames) / mAttackSpeed;
+
+ //attack particle effect
+ if (mEquippedWeapon)
+ particleEffect = mEquippedWeapon->getParticleEffect();
- break;
+ if (!particleEffect.empty() && Particle::enabled && 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
Being::logic();
}