summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game-server/charactercomponent.cpp29
-rw-r--r--src/game-server/charactercomponent.h11
-rw-r--r--src/game-server/gamehandler.cpp2
3 files changed, 17 insertions, 25 deletions
diff --git a/src/game-server/charactercomponent.cpp b/src/game-server/charactercomponent.cpp
index 89f3eeb3..11e90a65 100644
--- a/src/game-server/charactercomponent.cpp
+++ b/src/game-server/charactercomponent.cpp
@@ -110,8 +110,6 @@ CharacterComponent::CharacterComponent(Entity &entity, MessageIn &msg):
beingComponent->signal_attribute_changed.connect(sigc::mem_fun(
this, &CharacterComponent::attributeChanged));
-
- sendFullInfo(entity);
}
CharacterComponent::~CharacterComponent()
@@ -276,22 +274,6 @@ void CharacterComponent::serialize(Entity &entity, MessageOut &msg)
}
}
-void CharacterComponent::update(Entity &entity)
-{
- // Dead character: don't regenerate anything else
- if (entity.getComponent<BeingComponent>()->getAction() == DEAD)
- return;
-
- if (!mModifiedAbilities.empty())
- sendAbilityUpdate(entity);
-
- if (mSendAbilityCooldown)
- sendAbilityCooldownUpdate(entity);
-
- if (mSendAttributePointsStatus)
- sendAttributePointsStatus(entity);
-}
-
void CharacterComponent::characterDied(Entity *being)
{
executeCallback(mDeathCallback, *being);
@@ -448,6 +430,15 @@ void CharacterComponent::sendStatus(Entity &entity)
}
if (attribMsg.getLength() > 2) gameHandler->sendTo(mClient, attribMsg);
mModifiedAttributes.clear();
+
+ if (!mModifiedAbilities.empty())
+ sendAbilityUpdate(entity);
+
+ if (mSendAbilityCooldown)
+ sendAbilityCooldownUpdate(entity);
+
+ if (mSendAttributePointsStatus)
+ sendAttributePointsStatus(entity);
}
void CharacterComponent::modifiedAllAbilities(Entity &entity)
@@ -586,7 +577,7 @@ void CharacterComponent::triggerLoginCallback(Entity &entity)
executeCallback(mLoginCallback, entity);
}
-void CharacterComponent::sendFullInfo(Entity &entity)
+void CharacterComponent::markAllInfoAsChanged(Entity &entity)
{
modifiedAllAbilities(entity);
modifiedAllAttributes(entity);
diff --git a/src/game-server/charactercomponent.h b/src/game-server/charactercomponent.h
index 0e5d5ffd..fe3f028d 100644
--- a/src/game-server/charactercomponent.h
+++ b/src/game-server/charactercomponent.h
@@ -63,10 +63,7 @@ class CharacterComponent : public Component
~CharacterComponent();
- /**
- * calls Being::update and handles special recharges and status effects
- */
- void update(Entity &entity);
+ virtual void update(Entity &entity);
/**
* Executes the global die script
@@ -279,7 +276,7 @@ class CharacterComponent : public Component
void triggerLoginCallback(Entity &entity);
- void sendFullInfo(Entity &entity);
+ void markAllInfoAsChanged(Entity &entity);
sigc::signal<void, Entity &> signal_disconnected;
@@ -374,4 +371,8 @@ inline int CharacterComponent::getCorrectionPoints() const
return mCorrectionPoints;
}
+inline void CharacterComponent::update(Entity &entity)
+{
+}
+
#endif // CHARACTER_H
diff --git a/src/game-server/gamehandler.cpp b/src/game-server/gamehandler.cpp
index fa2c273f..6546d8d3 100644
--- a/src/game-server/gamehandler.cpp
+++ b/src/game-server/gamehandler.cpp
@@ -405,7 +405,7 @@ void GameHandler::tokenMatched(GameClient *computer, Entity *character)
computer->send(result);
Inventory(character).sendFull();
- characterComponent->sendFullInfo(*character);
+ characterComponent->markAllInfoAsChanged(*character);
}
void GameHandler::deletePendingClient(GameClient *computer)