Skip to content

Commit 5e8fb14

Browse files
Fix missing mtaserver.conf setting added from template not receiving attributes (#4452)
Fix duplicated <rule> tags
1 parent 48921f8 commit 5e8fb14

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Server/mods/deathmatch/logic/CMainConfig.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -916,7 +916,7 @@ bool CMainConfig::AddMissingSettings()
916916
CXMLAttribute* templateAttribute = *it3;
917917
const SString& attrName = templateAttribute->GetName();
918918

919-
// Don't check value attribute which is intended to be different
919+
// Don't check value attribute which is intended to be customized by the server
920920
if (attrName == "value")
921921
continue;
922922

@@ -946,6 +946,12 @@ bool CMainConfig::AddMissingSettings()
946946
foundNode->SetTagContent(templateNodeValue.c_str());
947947
foundNode->SetCommentText(templateNodeComment.c_str(), true);
948948

949+
for (auto it3 = templateAttributes.ListBegin(); it3 != templateAttributes.ListEnd(); ++it3)
950+
{
951+
CXMLAttribute* templateAttribute = *it3;
952+
foundNode->GetAttributes().Create(*templateAttribute);
953+
}
954+
949955
CLogger::LogPrintf("Added missing '%s' setting to mtaserver.conf\n", templateNodeName.c_str());
950956
configChanged = true;
951957
}

0 commit comments

Comments
 (0)