diff options
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 72f8776..e52393b 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 ab13e00..d0bcf46 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 195ea8d..704122d 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; |