diff --git a/sp/src/game/shared/ai_responsesystem_new.cpp b/sp/src/game/shared/ai_responsesystem_new.cpp index efa6d27c..e703775f 100644 --- a/sp/src/game/shared/ai_responsesystem_new.cpp +++ b/sp/src/game/shared/ai_responsesystem_new.cpp @@ -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; } diff --git a/sp/src/public/responserules/response_types.h b/sp/src/public/responserules/response_types.h index 821b0c57..4ec62cee 100644 --- a/sp/src/public/responserules/response_types.h +++ b/sp/src/public/responserules/response_types.h @@ -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 diff --git a/sp/src/responserules/runtime/response_types_internal.h b/sp/src/responserules/runtime/response_types_internal.h index 5222c80d..20cc9d54 100644 --- a/sp/src/responserules/runtime/response_types_internal.h +++ b/sp/src/responserules/runtime/response_types_internal.h @@ -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