mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-10-10 17:38:08 +00:00
I hope this works
This commit is contained in:
@@ -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,6 +2,7 @@
|
||||
|
||||
// Custom Classes
|
||||
#include "CDTable.h"
|
||||
#include "dCommonVars.h"
|
||||
|
||||
enum class eReplicaComponentType : uint32_t;
|
||||
struct CDComponentsRegistry {
|
||||
@@ -18,4 +19,5 @@ private:
|
||||
public:
|
||||
CDComponentsRegistryTable();
|
||||
int32_t GetByIDAndType(uint32_t id, eReplicaComponentType componentType, int32_t defaultValue = 0);
|
||||
std::vector<std::pair<eReplicaComponentType, uint32_t>> GetTemplateComponents(LOT templateId);
|
||||
};
|
||||
|
Reference in New Issue
Block a user