Fixed some issues with instanced response systems

This commit is contained in:
Blixibon 2021-07-26 13:14:51 -05:00
parent 2b1a8762bd
commit 5a11d51db4
3 changed files with 24 additions and 3 deletions

View File

@ -531,6 +531,9 @@ public:
virtual void LevelInitPostEntity() virtual void LevelInitPostEntity()
{ {
#ifdef MAPBASE
if (!rr_enhanced_saverestore.GetBool() || gpGlobals->eLoadType != MapLoad_Transition)
#endif
ResetResponseGroups(); ResetResponseGroups();
} }
@ -567,6 +570,16 @@ public:
virtual void LevelInitPostEntity() 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() virtual void Release()

View File

@ -192,6 +192,9 @@ CResponseSystem::CResponseSystem() :
token[0] = 0; token[0] = 0;
m_bUnget = false; m_bUnget = false;
m_bCustomManagable = false; m_bCustomManagable = false;
#ifdef MAPBASE
m_bInProspective = false;
#endif
BuildDispatchTables(); BuildDispatchTables();
} }
@ -1008,11 +1011,13 @@ int CResponseSystem::SelectWeightedResponseFromResponseGroup( ResponseGroup *g,
} }
if ( slot != -1 ) if ( slot != -1 )
{
#ifdef MAPBASE #ifdef MAPBASE
// Don't mark responses as used in prospective mode // Don't mark responses as used in prospective mode
if (m_bInProspective == false) if (m_bInProspective == false)
#endif #endif
g->MarkResponseUsed( slot ); g->MarkResponseUsed( slot );
}
// Revert fake depletion of unavailable choices // Revert fake depletion of unavailable choices
RevertFakedDepletes( g ); RevertFakedDepletes( g );

View File

@ -58,6 +58,9 @@ namespace ResponseRules
bool IsCustomManagable() { return m_bCustomManagable; } bool IsCustomManagable() { return m_bCustomManagable; }
#ifdef MAPBASE
virtual
#endif
void Clear(); void Clear();
void DumpDictionary( const char *pszName ); void DumpDictionary( const char *pszName );