diff --git a/dGame/Entity.cpp b/dGame/Entity.cpp index 1a99136e..cdd94671 100644 --- a/dGame/Entity.cpp +++ b/dGame/Entity.cpp @@ -80,6 +80,7 @@ #include "RacingStatsComponent.h" #include "CollectibleComponent.h" #include "ItemComponent.h" +#include "GhostComponent.h" // Table includes #include "CDComponentsRegistryTable.h" @@ -436,6 +437,8 @@ void Entity::Initialize() { AddComponent(); AddComponent(m_Character)->LoadFromXml(m_Character->GetXMLDoc()); + + AddComponent(); } if (compRegistryTable->GetByIDAndType(m_TemplateID, eReplicaComponentType::INVENTORY) > 0 || m_Character) { diff --git a/dGame/dComponents/CMakeLists.txt b/dGame/dComponents/CMakeLists.txt index b14d0eb8..59c49ce9 100644 --- a/dGame/dComponents/CMakeLists.txt +++ b/dGame/dComponents/CMakeLists.txt @@ -10,6 +10,7 @@ set(DGAME_DCOMPONENTS_SOURCES "ControllablePhysicsComponent.cpp" "DestroyableComponent.cpp" "DonationVendorComponent.cpp" + "GhostComponent.cpp" "InventoryComponent.cpp" "ItemComponent.cpp" "LevelProgressionComponent.cpp" diff --git a/dGame/dComponents/GhostComponent.cpp b/dGame/dComponents/GhostComponent.cpp new file mode 100644 index 00000000..56bb1670 --- /dev/null +++ b/dGame/dComponents/GhostComponent.cpp @@ -0,0 +1,4 @@ +#include "GhostComponent.h" + +// TODO Move ghosting related code from Player to here +GhostComponent::GhostComponent(Entity* parent) : Component(parent) {} diff --git a/dGame/dComponents/GhostComponent.h b/dGame/dComponents/GhostComponent.h new file mode 100644 index 00000000..d99ffcd9 --- /dev/null +++ b/dGame/dComponents/GhostComponent.h @@ -0,0 +1,13 @@ +#ifndef __GHOSTCOMPONENT__H__ +#define __GHOSTCOMPONENT__H__ + +#include "Component.h" +#include "eReplicaComponentType.h" + +class GhostComponent : public Component { +public: + static inline const eReplicaComponentType ComponentType = eReplicaComponentType::GHOST; + GhostComponent(Entity* parent); +}; + +#endif //!__GHOSTCOMPONENT__H__