diff --git a/sp/src/game/shared/ai_responsesystem_new.cpp b/sp/src/game/shared/ai_responsesystem_new.cpp index 6c3301bb..9b519902 100644 --- a/sp/src/game/shared/ai_responsesystem_new.cpp +++ b/sp/src/game/shared/ai_responsesystem_new.cpp @@ -531,6 +531,9 @@ public: virtual void LevelInitPostEntity() { +#ifdef MAPBASE + if (!rr_enhanced_saverestore.GetBool() || gpGlobals->eLoadType != MapLoad_Transition) +#endif ResetResponseGroups(); } @@ -567,6 +570,16 @@ public: virtual void LevelInitPostEntity() { +#ifdef MAPBASE + // CInstancedResponseSystem is not a CAutoGameSystem, so this needs to be called manually. + // The same could've been accomplished by making CInstancedResponseSystem derive from CAutoGameSystem, + // but their instanced nature would've complicated things a lot. + int c = m_InstancedSystems.Count(); + for ( int i = c - 1 ; i >= 0; i-- ) + { + m_InstancedSystems[i]->LevelInitPostEntity(); + } +#endif } virtual void Release() diff --git a/sp/src/responserules/runtime/response_system.cpp b/sp/src/responserules/runtime/response_system.cpp index 156bd45f..d294316d 100644 --- a/sp/src/responserules/runtime/response_system.cpp +++ b/sp/src/responserules/runtime/response_system.cpp @@ -192,6 +192,9 @@ CResponseSystem::CResponseSystem() : token[0] = 0; m_bUnget = false; m_bCustomManagable = false; +#ifdef MAPBASE + m_bInProspective = false; +#endif BuildDispatchTables(); } @@ -1008,11 +1011,13 @@ int CResponseSystem::SelectWeightedResponseFromResponseGroup( ResponseGroup *g, } if ( slot != -1 ) + { #ifdef MAPBASE - // Don't mark responses as used in prospective mode - if (m_bInProspective == false) + // Don't mark responses as used in prospective mode + if (m_bInProspective == false) #endif - g->MarkResponseUsed( slot ); + g->MarkResponseUsed( slot ); + } // Revert fake depletion of unavailable choices RevertFakedDepletes( g ); diff --git a/sp/src/responserules/runtime/response_system.h b/sp/src/responserules/runtime/response_system.h index b675e816..a862d761 100644 --- a/sp/src/responserules/runtime/response_system.h +++ b/sp/src/responserules/runtime/response_system.h @@ -58,6 +58,9 @@ namespace ResponseRules bool IsCustomManagable() { return m_bCustomManagable; } +#ifdef MAPBASE + virtual +#endif void Clear(); void DumpDictionary( const char *pszName );