Changeset View
Changeset View
Standalone View
Standalone View
source/ps/TemplateLoader.cpp
Show First 20 Lines • Show All 149 Lines • ▼ Show 20 Lines | if (std::unordered_map<std::string, CParamNode>::const_iterator it = m_TemplateFileData.find(templateName); it != m_TemplateFileData.end()) | ||||
return it->second; | return it->second; | ||||
CParamNode ret; | CParamNode ret; | ||||
if (!LoadTemplateFile(ret, templateName, false, 0)) | if (!LoadTemplateFile(ret, templateName, false, 0)) | ||||
{ | { | ||||
LOGERROR("Failed to load entity template '%s'", templateName.c_str()); | LOGERROR("Failed to load entity template '%s'", templateName.c_str()); | ||||
return NULL_NODE; | return NULL_NODE; | ||||
} | } | ||||
// Template component order is relevant, both for initialisation & validation, so sort them after loading. | |||||
ret.SortChildren(false); | |||||
return m_TemplateFileData.insert_or_assign(templateName, ret).first->second; | return m_TemplateFileData.insert_or_assign(templateName, ret).first->second; | ||||
} | } | ||||
void CTemplateLoader::ConstructTemplateActor(std::string_view actorName, CParamNode& out) | void CTemplateLoader::ConstructTemplateActor(std::string_view actorName, CParamNode& out) | ||||
{ | { | ||||
// Copy the actor template | // Copy the actor template | ||||
out = GetTemplateFileData("special/actor"); | out = GetTemplateFileData("special/actor"); | ||||
Show All 15 Lines |
Wildfire Games · Phabricator