From a05503e42bf4d6db58c1050d20f441e0350ce98e Mon Sep 17 00:00:00 2001 From: Blixibon Date: Thu, 18 Mar 2021 00:33:35 -0500 Subject: [PATCH] Fixed rr_disableemptyrules not always working correctly --- sp/src/responserules/runtime/response_system.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/sp/src/responserules/runtime/response_system.cpp b/sp/src/responserules/runtime/response_system.cpp index 15950b07..7867bda0 100644 --- a/sp/src/responserules/runtime/response_system.cpp +++ b/sp/src/responserules/runtime/response_system.cpp @@ -793,6 +793,15 @@ void CResponseSystem::ResetResponseGroups() { m_Responses[ i ].Reset(); } + +#ifdef MAPBASE + for ( ResponseRulePartition::tIndex idx = m_RulePartitions.First() ; + m_RulePartitions.IsValid(idx) ; + idx = m_RulePartitions.Next(idx) ) + { + m_RulePartitions[ idx ].m_bEnabled = true; + } +#endif } #ifdef MAPBASE @@ -1045,6 +1054,9 @@ bool CResponseSystem::ResolveResponse( ResponseSearchResult& searchResult, int d if ( g->IsNoRepeat() ) { g->SetEnabled( false ); +#ifdef MAPBASE + DisableEmptyRules(); +#endif return false; } idx = 0; @@ -1160,6 +1172,9 @@ bool CResponseSystem::GetBestResponse( ResponseSearchResult& searchResult, Rule if ( g->IsNoRepeat() ) { g->SetEnabled( false ); +#ifdef MAPBASE + DisableEmptyRules(); +#endif return false; } responseIndex = 0;