summaryrefslogtreecommitdiffstats
path: root/src/game-server/monstercombatcomponent.cpp
diff options
context:
space:
mode:
authorErik Schilling <ablu.erikschilling@googlemail.com>2013-04-10 23:04:42 +0200
committerErik Schilling <ablu.erikschilling@googlemail.com>2013-04-11 13:47:17 +0200
commitd7fa7ea64f6bb0bc0b097e4bf1ceb4bd9620d0da (patch)
tree1b4d200ba66c6afcdb7763951980476756339cf1 /src/game-server/monstercombatcomponent.cpp
parentaa04597c5f8bb806996d604699fc8ebff6d53bdd (diff)
downloadmanaserv-d7fa7ea64f6bb0bc0b097e4bf1ceb4bd9620d0da.tar.gz
manaserv-d7fa7ea64f6bb0bc0b097e4bf1ceb4bd9620d0da.tar.xz
manaserv-d7fa7ea64f6bb0bc0b097e4bf1ceb4bd9620d0da.zip
Converted Being into a Component
I did not really care too much about staying consistent with the use of static_casts to Actors since they are only temporary anyway until Actor is a component too.
Diffstat (limited to 'src/game-server/monstercombatcomponent.cpp')
-rw-r--r--src/game-server/monstercombatcomponent.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/game-server/monstercombatcomponent.cpp b/src/game-server/monstercombatcomponent.cpp
index 0fc0b48..35e2f24 100644
--- a/src/game-server/monstercombatcomponent.cpp
+++ b/src/game-server/monstercombatcomponent.cpp
@@ -23,7 +23,7 @@
#include "game-server/monster.h"
#include "scripting/scriptmanager.h"
-MonsterCombatComponent::MonsterCombatComponent(Being &monster,
+MonsterCombatComponent::MonsterCombatComponent(Entity &monster,
MonsterClass *specy):
CombatComponent(monster),
mDamageMutation(0)
@@ -37,11 +37,11 @@ MonsterCombatComponent::MonsterCombatComponent(Being &monster,
/**
* Performs an attack
*/
-void MonsterCombatComponent::processAttack(Being *source, Attack &attack)
+void MonsterCombatComponent::processAttack(Entity *source, Attack &attack)
{
if (!mTarget)
{
- source->setAction(STAND);
+ source->getComponent<BeingComponent>()->setAction(*source, STAND);
return;
}
@@ -69,8 +69,8 @@ void MonsterCombatComponent::processAttack(Being *source, Attack &attack)
/**
* Calls the damage function in Being and updates the aggro list
*/
-int MonsterCombatComponent::damage(Being &target,
- Being *source,
+int MonsterCombatComponent::damage(Entity &target,
+ Entity *source,
const Damage &damage)
{
Damage newDamage = damage;