Changeset View
Changeset View
Standalone View
Standalone View
source/ps/TemplateLoader.cpp
Show All 34 Lines | bool CTemplateLoader::LoadTemplateFile(CParamNode& node, std::string_view templateName, bool compositing, int depth) | ||||
if (templateName.compare(0, 6, "actor|") == 0) | if (templateName.compare(0, 6, "actor|") == 0) | ||||
{ | { | ||||
ConstructTemplateActor(templateName.substr(6), node); | ConstructTemplateActor(templateName.substr(6), node); | ||||
return true; | return true; | ||||
} | } | ||||
// Handle infinite loops more gracefully than running out of stack space and crashing | // Handle infinite loops more gracefully than running out of stack space and crashing | ||||
if (depth > 100) | if (depth > 100) | ||||
{ | { | ||||
LOGERROR("Probable infinite inheritance loop in entity template '%s'", std::string(templateName)); | LOGERROR("Probable infinite inheritance loop in entity template '%s'", templateName); | ||||
vladislavbelov: All supported fmt versions support that? | |||||
phositAuthorUnsubmitted Done Inline ActionsWhich version do we use? It is supported since 4.1.0 phosit: Which version do we use? It is supported since 4.1.0 | |||||
vladislavbelovUnsubmitted Done Inline ActionsSeems relatively old. For Windows and macOS we use 7+, for linux only few old distributives have 3. vladislavbelov: Seems relatively old. For Windows and macOS we use 7+, for linux only few old distributives… | |||||
phositAuthorUnsubmitted Done Inline ActionsShould i change it back? phosit: Should i change it back? | |||||
vladislavbelovUnsubmitted Done Inline ActionsTo answer that you need to make a search across the repository, if we already use std::string or similar in LOGERROR then you don't need to change it back. vladislavbelov: To answer that you need to make a search across the repository, if we already use `std::string`… | |||||
phositAuthorUnsubmitted Done Inline ActionsLOGERROR is already used with string_view: gui/CGUI.cpp line 1071 phosit: `LOGERROR` is already used with `string_view`: gui/CGUI.cpp line 1071 | |||||
return false; | return false; | ||||
} | } | ||||
size_t pos = templateName.find_first_of('|'); | size_t pos = templateName.find_first_of('|'); | ||||
if (pos != std::string::npos) | if (pos != std::string::npos) | ||||
{ | { | ||||
// 'foo|bar' pattern: 'bar' is treated as the parent of 'foo'. | // 'foo|bar' pattern: 'bar' is treated as the parent of 'foo'. | ||||
if (!LoadTemplateFile(node, templateName.substr(pos + 1), false, depth + 1)) | if (!LoadTemplateFile(node, templateName.substr(pos + 1), false, depth + 1)) | ||||
▲ Show 20 Lines • Show All 155 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
All supported fmt versions support that?