From 6e8554d1d2f6f35277ec75577ba1a13e97d503df Mon Sep 17 00:00:00 2001 From: Unreal Karaulov Date: Sat, 4 Dec 2021 23:04:08 +0300 Subject: [PATCH] Fix ConfigsExecutedForward (my mistake) (#1024) * Fix one big issue what broken all plugins! If found any config from servercmd, m_ConfigsExecutedForward not called !!!!!!! If m_ConfigsExecutedForward not called, this is broke all plugins where used m_ConfigsExecutedForward (example restmenu) Revert "Fix one big issue what broken all plugins!" This reverts commit 6ce36f22e1c278f0831ebbddbc1dbbceb91dacb9. * Fix m_ConfigsExecutedForward after my missprint from previous pr Fix my missprint from previous pull request https://github.com/alliedmodders/amxmodx/commit/275be8b0a89bdd9439c7e04f75f092345318c560 --- amxmodx/CoreConfig.cpp | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/amxmodx/CoreConfig.cpp b/amxmodx/CoreConfig.cpp index a2cbe222..6014842e 100644 --- a/amxmodx/CoreConfig.cpp +++ b/amxmodx/CoreConfig.cpp @@ -296,16 +296,19 @@ void CoreConfig::OnMapConfigTimer() return; } - if (m_PendingForwardPush) + if (m_legacyMapConfigNextTime <= gpGlobals->time) { - m_PendingForwardPush = false; - m_ConfigsExecuted = true; + if (m_PendingForwardPush) + { + m_PendingForwardPush = false; + m_ConfigsExecuted = true; - executeForwards(m_ConfigsExecutedForward); - } - else if (!m_LegacyMapConfigsExecuted && m_legacyMapConfigNextTime <= gpGlobals->time) - { - ExecuteMapConfig(); + executeForwards(m_ConfigsExecutedForward); + } + else if (!m_LegacyMapConfigsExecuted) + { + ExecuteMapConfig(); + } } } @@ -316,9 +319,17 @@ void CoreConfig::CheckLegacyBufferedCommand(char *command) return; } - if (!m_LegacyMainConfigExecuted && (strstr(command, MainConfigFile) || strstr(command, MapConfigDir))) + + if (!m_LegacyMainConfigExecuted && strstr(command, MainConfigFile)) { m_LegacyMainConfigExecuted = true; + } + + if (!m_LegacyMapConfigsExecuted && strstr(command, MapConfigDir)) + { + m_LegacyMapConfigsExecuted = true; + + // Consider all configs be executed to m_legacyMapConfigNextTime time. m_PendingForwardPush = true; } }