Stabilized implementation of some Mapbase code in the new response system

This commit is contained in:
Blixibon 2021-03-09 12:39:13 -06:00
parent efec7ab4db
commit 8966462fee
3 changed files with 27 additions and 3 deletions

View File

@ -974,7 +974,28 @@ bool LoadResponseSystemFile(const char *scriptfile)
delete rs;
*/
defaultresponsesytem.LoadFromBuffer(scriptfile, (const char *)buf.PeekGet());
// HACKHACK: This is not very efficient
/*
CInstancedResponseSystem *tempSys = new CInstancedResponseSystem( scriptfile );
if ( tempSys && tempSys->Init() )
{
tempSys->Precache();
for ( ResponseRulePartition::tIndex idx = tempSys->m_RulePartitions.First() ;
tempSys->m_RulePartitions.IsValid(idx) ;
idx = tempSys->m_RulePartitions.Next(idx) )
{
Rule &rule = tempSys->m_RulePartitions[idx];
tempSys->CopyRuleFrom( &rule, idx, &defaultresponsesytem );
}
tempSys->Release();
}
*/
// HACKHACK: This is even less efficient
defaultresponsesytem.LoadFromBuffer( scriptfile, (const char *)buf.PeekGet() );
defaultresponsesytem.Precache();
return true;
}

View File

@ -111,7 +111,9 @@ namespace ResponseRules
// CResponseSystem::BuildDispatchTables() - AI_ResponseSystem.cpp (with their own funcs for m_RuleDispatch)
// CRR_Response::Describe() - rr_response.cpp
// CAI_Expresser::SpeakDispatchResponse() - ai_speech.cpp
enum
//
// Also mind that this is 8-bit
enum : uint8
{
APPLYCONTEXT_SELF = (1 << 0), // Included for contexts that apply to both self and something else
APPLYCONTEXT_WORLD = (1 << 1), // Apply to world

View File

@ -340,7 +340,8 @@ namespace ResponseRules
uint8 m_nForceWeight;
#ifdef MAPBASE
int m_iContextFlags;
// TODO: Could this cause any issues with the code optimization?
uint8 m_iContextFlags;
#else
bool m_bApplyContextToWorld : 1;
#endif