Skip to content

Commit

Permalink
internal: create special vars instantly at addSpecialConfigValue
Browse files Browse the repository at this point in the history
  • Loading branch information
vaxerski committed Feb 13, 2024
1 parent ebffe8f commit 4a46473
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ void CConfig::addSpecialConfigValue(const char* cat, const char* name, const CCo
SConfigDefaultValue{reinterpret_cast<CConfigCustomValueType*>(value.m_pData)->defaultVal, (eDataType)value.m_eType,
reinterpret_cast<CConfigCustomValueType*>(value.m_pData)->handler,
reinterpret_cast<CConfigCustomValueType*>(value.m_pData)->dtor});

const auto CAT = std::find_if(impl->specialCategories.begin(), impl->specialCategories.end(), [cat](const auto& other) { return other->name == cat; });
if (CAT != impl->specialCategories.end())
CAT->get()->values[name].defaultFrom(IT->get()->defaultValues[name]);
}

void CConfig::removeSpecialConfigValue(const char* cat, const char* name) {
Expand Down

0 comments on commit 4a46473

Please sign in to comment.