From 7628783e95ba88b755a9da3ad97475684d9e8414 Mon Sep 17 00:00:00 2001 From: furo Date: Sun, 25 Aug 2024 20:20:13 +0200 Subject: [PATCH] Transfer server settings while using append --- src/game/editor/editor.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/game/editor/editor.cpp b/src/game/editor/editor.cpp index 4f2591914..8546a5fbd 100644 --- a/src/game/editor/editor.cpp +++ b/src/game/editor/editor.cpp @@ -8881,6 +8881,22 @@ bool CEditor::Append(const char *pFileName, int StorageType, bool IgnoreHistory) } NewMap.m_vpGroups.clear(); + // transfer server settings + for(const auto &pSetting : NewMap.m_vSettings) + { + // Check if setting already exists + bool AlreadyExists = false; + for(const auto &pExistingSetting : m_Map.m_vSettings) + { + if(!str_comp(pExistingSetting.m_aCommand, pSetting.m_aCommand)) + AlreadyExists = true; + } + if(!AlreadyExists) + m_Map.m_vSettings.push_back(pSetting); + } + + NewMap.m_vSettings.clear(); + auto IndexMap = SortImages(); if(!IgnoreHistory)