summaryrefslogtreecommitdiff
path: root/src/game-server/character.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game-server/character.cpp')
-rw-r--r--src/game-server/character.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/game-server/character.cpp b/src/game-server/character.cpp
index 8f35fef4..ab13e008 100644
--- a/src/game-server/character.cpp
+++ b/src/game-server/character.cpp
@@ -90,10 +90,7 @@ CharacterComponent::CharacterComponent(Entity &entity, MessageIn &msg):
mKnuckleAttackInfo(0),
mBaseEntity(&entity)
{
- // Temporary until all dependencies are in a component
- Actor &being = static_cast<Actor &>(entity);
-
- mCharacterData = new CharacterData(&being, this);
+ mCharacterData = new CharacterData(&entity, this);
auto *beingComponent = entity.getComponent<BeingComponent>();
@@ -105,12 +102,13 @@ CharacterComponent::CharacterComponent(Entity &entity, MessageIn &msg):
beingComponent->createAttribute(attributeScope.first,
*attributeScope.second);
-
- being.setWalkMask(Map::BLOCKMASK_WALL);
- being.setBlockType(BLOCKTYPE_CHARACTER);
+ auto *actorComponent = entity.getComponent<ActorComponent>();
+ actorComponent->setWalkMask(Map::BLOCKMASK_WALL);
+ actorComponent->setBlockType(BLOCKTYPE_CHARACTER);
+ actorComponent->setSize(16);
- CombatComponent *combatcomponent = new CombatComponent(being);
+ CombatComponent *combatcomponent = new CombatComponent(entity);
entity.addComponent(combatcomponent);
combatcomponent->getAttacks().attack_added.connect(
sigc::mem_fun(this, &CharacterComponent::attackAdded));
@@ -138,9 +136,8 @@ CharacterComponent::CharacterComponent(Entity &entity, MessageIn &msg):
deserializeCharacterData(*mCharacterData, msg);
- Inventory(&being, mPossessions).initialize();
- modifiedAllAttributes(entity);
- being.setSize(16);
+ Inventory(&entity, mPossessions).initialize();
+ modifiedAllAttributes(entity);;
beingComponent->signal_attribute_changed.connect(sigc::mem_fun(
this, &CharacterComponent::attributeChanged));