Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Rewrite Entity Component System #1110

Draft
wants to merge 122 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 121 commits
Commits
Show all changes
122 commits
Select commit Hold shift + click to select a range
c168f6c
Break out the model component
aronwk-aaron Feb 11, 2023
5097862
Merge branch 'main' into item-component
aronwk-aaron Feb 11, 2023
2ae9a92
fix cmake
aronwk-aaron Feb 11, 2023
c2d5be0
include
aronwk-aaron Mar 21, 2023
5e9a956
Merge branch 'main' into item-component
aronwk-aaron Mar 21, 2023
15988af
hey it compiles
aronwk-aaron Mar 21, 2023
716a5fc
Rename some variables in Component
EmosewaMC Jun 7, 2023
ea9d0d8
I hope this works
EmosewaMC Jun 7, 2023
9e9e4dc
Move to shared pointer
EmosewaMC Jun 7, 2023
d11e2db
update component names, document heirarchy
aronwk-aaron Jun 8, 2023
ec00f5f
holy mother of const
EmosewaMC Jun 9, 2023
62aa863
Remove shared pointer, ODR of componentType variable
EmosewaMC Jun 9, 2023
e2dfa18
Replace all auto with auto*
EmosewaMC Jun 9, 2023
f555ba8
Rename from GetOwningEntity to GetParentEntity
EmosewaMC Jun 9, 2023
6f05720
Rename some variables
EmosewaMC Jun 9, 2023
5da776a
Add blank classes for some Components
EmosewaMC Jun 9, 2023
f2d28cc
Update CMakeLists.txt
EmosewaMC Jun 9, 2023
0b37dc1
Update includes for propertyEnteranceComponent
EmosewaMC Jun 9, 2023
e3a716a
Further re-implement Entity::Initialize
EmosewaMC Jun 9, 2023
ddc5f0e
Merge branch 'main' into components-wheeeee
EmosewaMC Jun 9, 2023
a68fa69
Rename RebuildComponent to QuickbuildComponent
aronwk-aaron Jun 9, 2023
1c23f3c
Add test for component Whitelists
EmosewaMC Jun 10, 2023
2a27997
More robust tests
EmosewaMC Jun 10, 2023
5714ac5
Use std algorithms
EmosewaMC Jun 10, 2023
cebe3c7
Update to actually work with component list
EmosewaMC Jun 10, 2023
b91f84d
Collectible, Item, further re-implement initialize
EmosewaMC Jun 10, 2023
0b5df9f
Destroyable
EmosewaMC Jun 10, 2023
77dc6ff
Continued re-integration of Entity::Initialize
EmosewaMC Jun 11, 2023
5f139c7
Quickbuild and Destroyable reintegration
EmosewaMC Jun 11, 2023
b43e5c2
doesnt have a component
EmosewaMC Jun 11, 2023
f78ea1b
whitespace and comments in quickbuild
EmosewaMC Jun 11, 2023
fc719cb
Comment out done code
EmosewaMC Jun 11, 2023
36c44ec
Fully re-implemented initialize
EmosewaMC Jun 12, 2023
6f38a15
Minor formatting change
EmosewaMC Jun 12, 2023
262b6eb
Remove old Entity Initialize
EmosewaMC Jun 12, 2023
5be9146
Specify auto ptr
EmosewaMC Jun 12, 2023
3f38105
Extra * on one auto
EmosewaMC Jun 12, 2023
f9ac0a9
few more pointer specifiers
EmosewaMC Jun 12, 2023
d224a86
Use only 1 script component per Entity
EmosewaMC Jun 12, 2023
326c495
Use more clear control paths
EmosewaMC Jun 12, 2023
b2fee29
Better log and comment
EmosewaMC Jun 12, 2023
45bcc80
doesnt compile
EmosewaMC Jun 12, 2023
e389a61
update heirarchy
aronwk-aaron Jun 13, 2023
d8e2e92
use get
EmosewaMC Jun 14, 2023
31be1fb
remove script stuff
EmosewaMC Jun 14, 2023
fdd98ab
fix other script calls
aronwk-aaron Jun 14, 2023
83065df
I havent checked if this compiled
EmosewaMC Jun 15, 2023
451f7e7
switch to unique_ptrs for callback timers
EmosewaMC Jun 15, 2023
355f4f4
Update Entity.cpp
EmosewaMC Jun 15, 2023
2a8f40f
Finish file
EmosewaMC Jun 15, 2023
4d57eff
Update includes
EmosewaMC Jun 15, 2023
35e5d84
Remove empty destructors
EmosewaMC Jun 15, 2023
ea97596
Fix typo
EmosewaMC Jun 16, 2023
9a9b9aa
Merge branch 'components-wheeeee' of https://github.com/DarkflameUniv…
EmosewaMC Jun 16, 2023
9200612
Another consistency pass
EmosewaMC Jun 16, 2023
8916482
Organize Entity header
EmosewaMC Jun 16, 2023
a992a28
Merge from upstream
EmosewaMC Jun 16, 2023
be17d1a
Update DestroyableComponent.cpp
EmosewaMC Jun 16, 2023
68a5cc1
Use better API terminology for radii
EmosewaMC Jun 17, 2023
1bdec00
More organization of header
EmosewaMC Jun 17, 2023
e180430
Finish header re-ordering
EmosewaMC Jun 18, 2023
dc96fcb
Vendor cleanup and start Donation Vendor impl
aronwk-aaron Jun 23, 2023
907e045
some tweaks
aronwk-aaron Jun 23, 2023
c78760d
make inheritence clearer
aronwk-aaron Jun 23, 2023
f27e040
scaffold activity based components
aronwk-aaron Jun 23, 2023
bcbc588
Merge branch 'main' into components-wheeeee
aronwk-aaron Jun 23, 2023
34d22d2
AchievementVendor scaffold
aronwk-aaron Jun 23, 2023
d153d66
Merge branch 'item-component' into components-wheeeee
aronwk-aaron Jun 23, 2023
d44b18e
rough logic around loading physics
aronwk-aaron Jun 23, 2023
c237c16
group physicstogether in heirarchy
aronwk-aaron Jun 23, 2023
485a88d
move vars to be local
aronwk-aaron Jun 24, 2023
3f328a1
Merge upstream ghosting candidate changes
EmosewaMC Jun 26, 2023
fee1025
Remove commented out logic, add ghosting exclusion
EmosewaMC Jun 26, 2023
9121bf4
Entity work
EmosewaMC Jun 26, 2023
ec92782
Use better naming
EmosewaMC Jun 26, 2023
34cfd45
CombatAI and Vendor
EmosewaMC Jun 26, 2023
a5611e9
Bouncer cleanup
EmosewaMC Jun 26, 2023
06acd23
Use of final
EmosewaMC Jun 26, 2023
d29287f
Buff Component fixes
EmosewaMC Jun 26, 2023
68f90b7
rename possessor to possession
aronwk-aaron Jun 26, 2023
fd182d2
Update activing and racing components
aronwk-aaron Jun 26, 2023
fdcfbde
BuildBorderCleanup
EmosewaMC Jun 27, 2023
d9a3bea
Merge branch 'components-wheeeee' of https://github.com/DarkflameUniv…
EmosewaMC Jun 27, 2023
2abcb14
Character fixes - get it compiling again
EmosewaMC Jun 27, 2023
c6063aa
Component serialization updates
EmosewaMC Jun 27, 2023
7c12659
move ctor to header for collectible
EmosewaMC Jun 27, 2023
478b6ff
Move empty definitions to header
EmosewaMC Jun 27, 2023
f55bec0
Donation Component serialization
EmosewaMC Jun 27, 2023
c2fe7f6
HavokVehicleComponent improvements
EmosewaMC Jun 27, 2023
0544eeb
Add default constructor for EquipmentItem
EmosewaMC Jun 27, 2023
81404d9
InventoryComponent pass
EmosewaMC Jun 28, 2023
6fb1786
Add component order array
aronwk-aaron Jun 29, 2023
c22040c
ItemComponent Pass
EmosewaMC Jul 5, 2023
8ede5b8
Fix compilation error; add final specifiers
EmosewaMC Jul 5, 2023
cfec980
LevelProgressionComponent cleanup
EmosewaMC Jul 5, 2023
68a2a04
LUPExhibitComponent cleanup
EmosewaMC Jul 5, 2023
197d1bc
Merge branch 'main' into components-wheeeee
aronwk-aaron Jul 5, 2023
950a1fe
MissionComponent pass
EmosewaMC Jul 6, 2023
001f6a7
MissionOfferComponent pass
EmosewaMC Jul 6, 2023
5301346
ModelBehaviorComponent pass
EmosewaMC Jul 6, 2023
cf53e35
SwitchComponent pass
EmosewaMC Jul 7, 2023
28fbe20
ModuleAssemblyComponent pass
EmosewaMC Jul 8, 2023
790bd6c
Merge branch 'components-wheeeee' of https://github.com/DarkflameUniv…
EmosewaMC Jul 8, 2023
1b7be5d
Merge branch 'components-wheeeee' of https://github.com/DarkflameUniv…
EmosewaMC Jul 10, 2023
2528e02
add final
EmosewaMC Jul 10, 2023
8a512e5
MovementAiComponent pass
EmosewaMC Jul 10, 2023
d2a7e14
I am throwing this one out later.
EmosewaMC Jul 10, 2023
7ca9e59
MultiZoneEntranceComponent pass
EmosewaMC Jul 10, 2023
83780af
MutableModelBehaviorComponent pass
EmosewaMC Jul 10, 2023
87675aa
PetComponent pass
EmosewaMC Jul 10, 2023
28637a2
PhantomPhysicsComponent pass
EmosewaMC Jul 10, 2023
598d88b
PlayerForcedMovementComponent pass
EmosewaMC Jul 10, 2023
fe6b279
PossessableComponent pass
EmosewaMC Jul 10, 2023
59831fc
PhantomPhysicsComponent pass
EmosewaMC Jul 10, 2023
4d88f63
PossessionComponent pass
EmosewaMC Jul 10, 2023
37bcc81
PropertyComponent pass
EmosewaMC Jul 10, 2023
8678ed0
push no pass
EmosewaMC Jul 11, 2023
a37ec32
idek if ill keep this but yeah
EmosewaMC Jul 11, 2023
c204ea4
PropertyVendorComponent pass
EmosewaMC Jul 11, 2023
49f3d75
ProximityMonitorComponent re-pass
EmosewaMC Jul 11, 2023
949a6db
RailActivatorComponent pass
EmosewaMC Jul 11, 2023
6240eef
local work
EmosewaMC Jul 11, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ trim_trailing_whitespace=true
end_of_line=lf
insert_final_newline=true

[*.{c++,cc,cpp,cxx,h,h++,hh,hpp,hxx,inl,ipp,tlh,tli}]
[*.{c++,cc,cpp,cxx,h,h++,hh,hpp,hxx,inl,ipp,tlh,tli,tcc,tpp}]

vc_generate_documentation_comments=doxygen_slash_star

Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ file(
file(
GLOB HEADERS_DGAME
LIST_DIRECTORIES false
${PROJECT_SOURCE_DIR}/dGame/Entity.h
${PROJECT_SOURCE_DIR}/dGame/dEntity/Entity.h
${PROJECT_SOURCE_DIR}/dGame/dGameMessages/GameMessages.h
${PROJECT_SOURCE_DIR}/dGame/EntityManager.h
${PROJECT_SOURCE_DIR}/dScripts/CppScripts.h
Expand Down
2 changes: 1 addition & 1 deletion CMakeVariables.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ __dynamic=1
# Set __compile_backtrace__ to 1 to compile the backtrace library instead of using system libraries.
# __compile_backtrace__=1
# Set to the number of jobs (make -j equivalent) to compile the mariadbconn files with.
__maria_db_connector_compile_jobs__=1
__maria_db_connector_compile_jobs__=
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: Do not ship with this.

# When set to 1 and uncommented, compiling and linking testing folders and libraries will be done.
__enable_testing__=1
# The path to OpenSSL. Change this if your OpenSSL install path is different than the default.
Expand Down
4 changes: 2 additions & 2 deletions dCommon/LDFFormat.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class LDFBaseData {

virtual void WriteToPacket(RakNet::BitStream* packet) = 0;

virtual const std::u16string& GetKey() = 0;
virtual const std::u16string& GetKey() const = 0;

virtual eLDFType GetValueType() = 0;

Expand Down Expand Up @@ -117,7 +117,7 @@ class LDFData: public LDFBaseData {
/*!
\return The key
*/
const std::u16string& GetKey(void) override { return this->key; }
const std::u16string& GetKey(void) const override { return this->key; }

//! Gets the LDF Type
/*!
Expand Down
7 changes: 7 additions & 0 deletions dCommon/dEnums/dCommonVars.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ const uint32_t LWOCLONEID_INVALID = -1; //!< Invalid LWOCLONEID
const uint16_t LWOINSTANCEID_INVALID = -1; //!< Invalid LWOINSTANCEID
const uint16_t LWOMAPID_INVALID = -1; //!< Invalid LWOMAPID
const uint64_t LWOZONEID_INVALID = 0; //!< Invalid LWOZONEID
const LOT LOT_ZONE_CONTROL = 2365;
const LOT LOT_3D_AMBIENT_SOUND = 6368;
const LOT LOT_MODEL_IN_WORLD = 14;
const LOT LOT_THINKING_CAP = 6086;
const LOT LOT_ROCKET = 6416;
const LOT LOT_LEGACY_RESPAWN_POINT = 4945;


const float PI = 3.14159f;

Expand Down
14 changes: 14 additions & 0 deletions dCommon/dEnums/ePhysicsBehaviorType.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#ifndef __EPHYSICSBEHAVIORTYPE__H__
#define __EPHYSICSBEHAVIORTYPE__H__

#include <cstdint>

enum class ePhysicsBehaviorType : int32_t {
INVALID = -1,
GROUND,
FLYING,
STANDARD,
DYNAMIC
};

#endif //!__EPHYSICSBEHAVIORTYPE__H__
40 changes: 20 additions & 20 deletions dCommon/dEnums/eReplicaComponentType.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ enum class eReplicaComponentType : uint32_t {
CHARACTER,
SCRIPT,
BOUNCER,
BUFF, // buff is really 98, this is DESTROYABLE
DESTROYABLE,
GHOST,
SKILL,
SPAWNER,
SPAWN,
ITEM,
REBUILD,
REBUILD_START,
REBUILD_ACTIVATOR,
MODULAR_BUILD,
BUILD_CONTROLLER,
BUILD_ACTIVATOR,
ICON_ONLY,
VENDOR,
INVENTORY,
Expand All @@ -33,8 +33,8 @@ enum class eReplicaComponentType : uint32_t {
PET,
PLATFORM_BOUNDARY,
MODULE,
ARCADE,
VEHICLE_PHYSICS, // Havok demo based
JETPACKPAD,
HAVOK_VEHICLE_PHYSICS,
MOVEMENT_AI,
EXHIBIT,
OVERHEAD_ICON,
Expand All @@ -46,23 +46,23 @@ enum class eReplicaComponentType : uint32_t {
SCRIPTED_ACTIVITY,
PHANTOM_PHYSICS,
SPRINGPAD,
MODEL,
MODEL_BEHAVIOR,
PROPERTY_ENTRANCE,
FX,
PROPERTY_MANAGEMENT,
VEHICLE_PHYSICS_NEW, // internal physics based on havok
VEHICLE_PHYSICS,
PHYSICS_SYSTEM,
QUICK_BUILD,
SWITCH,
ZONE_CONTROL, // Minigame
CHANGLING,
MINIGAME_CONTROL,
CHANGLING_BUILD,
CHOICE_BUILD,
PACKAGE,
SOUND_REPEATER,
SOUND_AMBIENT_2D,
SOUND_AMBIENT_3D,
PRECONDITION,
PLAYER_FLAG,
FLAG,
CUSTOM_BUILD_ASSEMBLY,
BASE_COMBAT_AI,
MODULE_ASSEMBLY,
Expand All @@ -71,8 +71,8 @@ enum class eReplicaComponentType : uint32_t {
GENERIC_ACTIVATOR,
PROPERTY_VENDOR,
HF_LIGHT_DIRECTION_GADGET,
ROCKET_LAUNCH,
ROCKET_LANDING,
ROCKET_LAUNCHPAD_CONTROL,
ROCKET_ANIMATION_CONTROL,
TRIGGER,
DROPPED_LOOT,
RACING_CONTROL,
Expand All @@ -84,7 +84,7 @@ enum class eReplicaComponentType : uint32_t {
SOUND_TRIGGER,
PROXIMITY_MONITOR,
RACING_SOUND_TRIGGER,
CHAT,
CHAT_BUBBLE,
FRIENDS_LIST,
GUILD,
LOCAL_SYSTEM,
Expand All @@ -101,27 +101,27 @@ enum class eReplicaComponentType : uint32_t {
TRADE,
USER_CONTROL,
IGNORE_LIST,
ROCKET_LAUNCH_LUP,
BUFF_REAL, // the real buff component, should just be name BUFF
MULTI_ZONE_ENTRANCE,
BUFF,
INTERACTION_MANAGER,
DONATION_VENDOR,
COMBAT_MEDIATOR,
COMMENDATION_VENDOR,
ACHIEVEMENT_VENDOR,
GATE_RUSH_CONTROL,
RAIL_ACTIVATOR,
ROLLER,
PLAYER_FORCED_MOVEMENT,
CRAFTING,
POSSESSABLE,
LEVEL_PROGRESSION,
POSSESSOR,
POSSESSION,
MOUNT_CONTROL,
UNKNOWN_112,
PROPERTY_PLAQUE,
BUILD_BORDER,
UNKNOWN_115,
CULLING_PLANE,
DESTROYABLE = 1000 // Actually 7
NUMBER_OF_COMPONENTS
};

#endif //!__EREPLICACOMPONENTTYPE__H__
13 changes: 13 additions & 0 deletions dCommon/dEnums/eUgcModerationStatus.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

#ifndef __EUGCMODERATIONSTATUS__H__
#define __EUGCMODERATIONSTATUS__H__

#include <cstdint>

enum class eUgcModerationStatus : uint32_t {
NoStatus,
Approved,
Rejected,
};

#endif //!__EUGCMODERATIONSTATUS__H__
9 changes: 8 additions & 1 deletion dDatabase/Tables/CDComponentsRegistryTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,11 @@ int32_t CDComponentsRegistryTable::GetByIDAndType(uint32_t id, eReplicaComponent
return defaultValue;
#endif
}

std::vector<std::pair<eReplicaComponentType, uint32_t>> CDComponentsRegistryTable::GetTemplateComponents(LOT templateId) {
std::vector<std::pair<eReplicaComponentType, uint32_t>> components;
for (int8_t i = 0; static_cast<eReplicaComponentType>(i) < eReplicaComponentType::NUMBER_OF_COMPONENTS; i++) {
auto compId = GetByIDAndType(templateId, static_cast<eReplicaComponentType>(i), -1);
if (compId != -1) components.push_back(std::make_pair(static_cast<eReplicaComponentType>(i), compId));
}
return components;
}
2 changes: 2 additions & 0 deletions dDatabase/Tables/CDComponentsRegistryTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

// Custom Classes
#include "CDTable.h"
#include "dCommonVars.h"

enum class eReplicaComponentType : uint32_t;
struct CDComponentsRegistry {
Expand All @@ -18,4 +19,5 @@ class CDComponentsRegistryTable : public CDTable<CDComponentsRegistryTable> {
public:
CDComponentsRegistryTable();
int32_t GetByIDAndType(uint32_t id, eReplicaComponentType componentType, int32_t defaultValue = 0);
std::vector<std::pair<eReplicaComponentType, uint32_t>> GetTemplateComponents(LOT templateId);
};
14 changes: 8 additions & 6 deletions dDatabase/Tables/CDItemComponentTable.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#include "CDItemComponentTable.h"
#include "GeneralUtils.h"

#include "eItemType.h"

CDItemComponent CDItemComponentTable::Default = {};

//! Constructor
Expand Down Expand Up @@ -74,20 +76,20 @@ CDItemComponentTable::CDItemComponentTable(void) {
#endif
}

const CDItemComponent& CDItemComponentTable::GetItemComponentByID(unsigned int skillID) {
const auto& it = this->entries.find(skillID);
const CDItemComponent& CDItemComponentTable::GetItemComponentByID(unsigned int id) {
const auto& it = this->entries.find(id);
if (it != this->entries.end()) {
return it->second;
}

#ifndef CDCLIENT_CACHE_ALL
std::stringstream query;

query << "SELECT * FROM ItemComponent WHERE id = " << std::to_string(skillID);
query << "SELECT * FROM ItemComponent WHERE id = " << std::to_string(id);

auto tableData = CDClientDatabase::ExecuteQuery(query.str());
if (tableData.eof()) {
entries.insert(std::make_pair(skillID, Default));
entries.insert(std::make_pair(id, Default));
return Default;
}

Expand All @@ -98,7 +100,7 @@ const CDItemComponent& CDItemComponentTable::GetItemComponentByID(unsigned int s
entry.baseValue = tableData.getIntField("baseValue", -1);
entry.isKitPiece = tableData.getIntField("isKitPiece", -1) == 1 ? true : false;
entry.rarity = tableData.getIntField("rarity", 0);
entry.itemType = tableData.getIntField("itemType", -1);
entry.itemType = static_cast<eItemType>(tableData.getIntField("itemType", -1));
entry.itemInfo = tableData.getInt64Field("itemInfo", -1);
entry.inLootTable = tableData.getIntField("inLootTable", -1) == 1 ? true : false;
entry.inVendor = tableData.getIntField("inVendor", -1) == 1 ? true : false;
Expand Down Expand Up @@ -140,7 +142,7 @@ const CDItemComponent& CDItemComponentTable::GetItemComponentByID(unsigned int s
tableData.nextRow();
}

const auto& it2 = this->entries.find(skillID);
const auto& it2 = this->entries.find(id);
if (it2 != this->entries.end()) {
return it2->second;
}
Expand Down
6 changes: 4 additions & 2 deletions dDatabase/Tables/CDItemComponentTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
#include "CDTable.h"
#include "dCommonVars.h"

enum class eItemType : int32_t;

struct CDItemComponent {
unsigned int id; //!< The Component ID
std::string equipLocation; //!< The equip location
unsigned int baseValue; //!< The monetary base value of the item
bool isKitPiece; //!< Whether or not the item belongs to a kit
unsigned int rarity; //!< The rarity of the item
unsigned int itemType; //!< The item type
eItemType itemType; //!< The item type
int64_t itemInfo; //!< The item info
bool inLootTable; //!< Whether or not the item is in a loot table
bool inVendor; //!< Whether or not the item is in a vendor inventory
Expand Down Expand Up @@ -58,7 +60,7 @@ class CDItemComponentTable : public CDTable<CDItemComponentTable> {
static std::map<LOT, uint32_t> ParseCraftingCurrencies(const CDItemComponent& itemComponent);

// Gets an entry by ID
const CDItemComponent& GetItemComponentByID(unsigned int skillID);
const CDItemComponent& GetItemComponentByID(unsigned int id);

static CDItemComponent Default;
};
7 changes: 2 additions & 5 deletions dDatabase/Tables/CDPhysicsComponentTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,7 @@ CDPhysicsComponentTable::~CDPhysicsComponentTable() {
}

CDPhysicsComponent* CDPhysicsComponentTable::GetByID(unsigned int componentID) {
for (auto e : m_entries) {
if (e.first == componentID) return e.second;
}

return nullptr;
auto itr = m_entries.find(componentID);
return itr != m_entries.end() ? itr->second : nullptr;
}

1 change: 0 additions & 1 deletion dGame/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
set(DGAME_SOURCES "Character.cpp"
"Entity.cpp"
"EntityManager.cpp"
"LeaderboardManager.cpp"
"Player.cpp"
Expand Down
Loading