diff options
author | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2013-04-12 14:51:10 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2013-04-12 15:08:02 +0200 |
commit | f04f62249ae52e256cb889dfa17eed1f02efcbce (patch) | |
tree | 9e056215c6e9595b4ed7bf0c1254b8b7c489ecbb /src | |
parent | 9e6a0f98ecb52e04ab5afce817cb1d7fe2076450 (diff) | |
download | manaserv-f04f62249ae52e256cb889dfa17eed1f02efcbce.tar.gz manaserv-f04f62249ae52e256cb889dfa17eed1f02efcbce.tar.bz2 manaserv-f04f62249ae52e256cb889dfa17eed1f02efcbce.tar.xz manaserv-f04f62249ae52e256cb889dfa17eed1f02efcbce.zip |
Removed CharacterData member from CharacterComponent
It is only needed temporarily while serializing and deserializing.
Diffstat (limited to 'src')
-rw-r--r-- | src/game-server/accountconnection.cpp | 2 | ||||
-rw-r--r-- | src/game-server/character.cpp | 5 | ||||
-rw-r--r-- | src/game-server/character.h | 5 |
3 files changed, 3 insertions, 9 deletions
diff --git a/src/game-server/accountconnection.cpp b/src/game-server/accountconnection.cpp index 72f87763..e52393bd 100644 --- a/src/game-server/accountconnection.cpp +++ b/src/game-server/accountconnection.cpp @@ -107,7 +107,7 @@ void AccountConnection::sendCharacterData(Entity *p) MessageOut msg(GAMSG_PLAYER_DATA); auto *characterComponent = p->getComponent<CharacterComponent>(); msg.writeInt32(characterComponent->getDatabaseID()); - serializeCharacterData(*characterComponent->getCharacterData(), msg); + serializeCharacterData(CharacterData(p, characterComponent), msg); send(msg); } diff --git a/src/game-server/character.cpp b/src/game-server/character.cpp index ab13e008..d0bcf467 100644 --- a/src/game-server/character.cpp +++ b/src/game-server/character.cpp @@ -90,8 +90,6 @@ CharacterComponent::CharacterComponent(Entity &entity, MessageIn &msg): mKnuckleAttackInfo(0), mBaseEntity(&entity) { - mCharacterData = new CharacterData(&entity, this); - auto *beingComponent = entity.getComponent<BeingComponent>(); const AttributeManager::AttributeScope &attributes = @@ -134,7 +132,8 @@ CharacterComponent::CharacterComponent(Entity &entity, MessageIn &msg): mDatabaseID = msg.readInt32(); beingComponent->setName(msg.readString()); - deserializeCharacterData(*mCharacterData, msg); + CharacterData characterData(&entity, this); + deserializeCharacterData(characterData, msg); Inventory(&entity, mPossessions).initialize(); modifiedAllAttributes(entity);; diff --git a/src/game-server/character.h b/src/game-server/character.h index 195ea8d9..704122db 100644 --- a/src/game-server/character.h +++ b/src/game-server/character.h @@ -467,9 +467,6 @@ class CharacterComponent : public Component void attackAdded(CombatComponent *combatComponent, Attack &attackInfo); void attackRemoved(CombatComponent *combatComponent, Attack &attackInfo); - CharacterData *getCharacterData() - { return mCharacterData; } - sigc::signal<void, Entity &> signal_disconnected; private: @@ -570,8 +567,6 @@ class CharacterComponent : public Component IS AVOIDABLE in order to allow refactoring this easier later! */ - CharacterData *mCharacterData; - static Script::Ref mDeathCallback; static Script::Ref mDeathAcceptedCallback; static Script::Ref mLoginCallback; |