summaryrefslogtreecommitdiffstats
path: root/src/game-server/spawnareacomponent.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game-server/spawnareacomponent.cpp')
-rw-r--r--src/game-server/spawnareacomponent.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/game-server/spawnareacomponent.cpp b/src/game-server/spawnareacomponent.cpp
index 557a2da..843371a 100644
--- a/src/game-server/spawnareacomponent.cpp
+++ b/src/game-server/spawnareacomponent.cpp
@@ -67,10 +67,12 @@ void SpawnAreaComponent::update(Entity &entity)
const int width = mZone.w;
const int height = mZone.h;
- Being *being = new Being(OBJECT_MONSTER);
+ Actor *being = new Actor(OBJECT_MONSTER);
+ auto *beingComponent = new BeingComponent(*being);
+ being->addComponent(beingComponent);
being->addComponent(new MonsterComponent(*being, mSpecy));
- if (being->getModifiedAttribute(ATTR_MAX_HP) <= 0)
+ if (beingComponent->getModifiedAttribute(ATTR_MAX_HP) <= 0)
{
LOG_WARN("Refusing to spawn dead monster " << mSpecy->getId());
delete being;
@@ -96,7 +98,7 @@ void SpawnAreaComponent::update(Entity &entity)
being->setMap(map);
being->setPosition(position);
- being->clearDestination();
+ beingComponent->clearDestination(*being);
GameState::enqueueInsert(being);
mNumBeings++;