load imagination costs for pet abilities from CDClient

This commit is contained in:
jadebenn
2024-04-18 23:31:27 -05:00
parent 0b4d7b6d92
commit 36e0dbdb5e
8 changed files with 102 additions and 22 deletions

View File

@@ -50,13 +50,13 @@ void CDPetComponentTable::LoadValuesFromDatabase() {
}
void CDPetComponentTable::LoadValuesFromDefaults() {
GetEntriesMutable().insert(std::make_pair(defaultEntry.id, defaultEntry));
GetEntriesMutable().emplace(defaultEntry.id, defaultEntry);
}
CDPetComponent& CDPetComponentTable::GetByID(const uint32_t componentID) {
auto& entries = GetEntriesMutable();
auto itr = entries.find(componentID);
if (itr == entries.end()) {
const CDPetComponent& CDPetComponentTable::GetByID(const uint32_t componentID) {
const auto& entries = GetEntriesMutable();
const auto itr = entries.find(componentID);
if (itr == entries.cend()) {
LOG("Unable to load pet component (ID %i) values from database! Using default values instead.", componentID);
return defaultEntry;
}