summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/being.cpp8
-rw-r--r--src/being.h4
-rw-r--r--src/monster.cpp18
-rw-r--r--src/monster.h4
4 files changed, 2 insertions, 32 deletions
diff --git a/src/being.cpp b/src/being.cpp
index 657e2236..85095804 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -352,15 +352,10 @@ void Being::takeDamage(Being *attacker, int amount, AttackType type)
}
}
-#ifdef TMWSERV_SUPPORT
-void Being::handleAttack()
-#else
void Being::handleAttack(Being *victim, int damage, AttackType type)
-#endif
{
if (this != player_node)
- setAction(Being::ATTACK);
-#ifdef EATHENA_SUPPORT
+ setAction(Being::ATTACK, 1);
if (getType() == PLAYER && victim)
{
if (mEquippedWeapon && mEquippedWeapon->getAttackType() == ACTION_ATTACK_BOW)
@@ -379,6 +374,7 @@ void Being::handleAttack(Being *victim, int damage, AttackType type)
}
}
}
+#ifdef EATHENA_SUPPORT
mFrame = 0;
mWalkTime = tick_time;
#endif
diff --git a/src/being.h b/src/being.h
index e5068952..6eef83c6 100644
--- a/src/being.h
+++ b/src/being.h
@@ -229,11 +229,7 @@ class Being : public Sprite, public ConfigListener
* @param damage the amount of damage dealt (0 means miss)
* @param type the attack type
*/
-#ifdef TMWSERV_SUPPORT
- virtual void handleAttack();
-#else
virtual void handleAttack(Being *victim, int damage, AttackType type);
-#endif
/**
* Returns the name of the being.
diff --git a/src/monster.cpp b/src/monster.cpp
index 92e1f84a..3192abf5 100644
--- a/src/monster.cpp
+++ b/src/monster.cpp
@@ -156,22 +156,6 @@ void Monster::setAction(Action action, int attackType)
}
}
-#ifdef TMWSERV_SUPPORT
-
-void Monster::handleAttack()
-{
- Being::handleAttack();
-
- const MonsterInfo &mi = getInfo();
-
- // TODO: It's not possible to determine hit or miss here, so this stuff
- // probably needs to be moved somewhere else. We may lose synchronization
- // between attack animation and the sound, unless we adapt the protocol...
- sound.playSfx(mi.getSound(MONSTER_EVENT_HIT));
-}
-
-#else
-
void Monster::handleAttack(Being *victim, int damage, AttackType type)
{
Being::handleAttack(victim, damage, type);
@@ -181,8 +165,6 @@ void Monster::handleAttack(Being *victim, int damage, AttackType type)
MONSTER_EVENT_HIT : MONSTER_EVENT_MISS));
}
-#endif
-
void Monster::takeDamage(Being *attacker, int amount, AttackType type)
{
if (amount > 0)
diff --git a/src/monster.h b/src/monster.h
index 7b44b5a8..29b04eab 100644
--- a/src/monster.h
+++ b/src/monster.h
@@ -53,11 +53,7 @@ class Monster : public Being
* @param damage the amount of damage dealt (0 means miss)
* @param type the attack type
*/
-#ifdef TMWSERV_SUPPORT
- virtual void handleAttack();
-#else
virtual void handleAttack(Being *victim, int damage, AttackType type);
-#endif
/**
* Puts a damage bubble above this monster and plays the hurt sound