MCPcopy Create free account
hub / github.com/BSVino/DoubleAction / CopyRuleFrom

Method CopyRuleFrom

mp/src/game/server/AI_ResponseSystem.cpp:2780–2807  ·  view source on GitHub ↗

----------------------------------------------------------------------------- Purpose: -----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

2778// Purpose:
2779//-----------------------------------------------------------------------------
2780void CResponseSystem::CopyRuleFrom( Rule *pSrcRule, int iRule, CResponseSystem *pCustomSystem )
2781{
2782 // Verify data.
2783 Assert( pSrcRule );
2784 Assert( pCustomSystem );
2785 if ( !pSrcRule || !pCustomSystem )
2786 return;
2787
2788 // New rule
2789 Rule dstRule;
2790
2791 dstRule.SetContext( pSrcRule->GetContext() );
2792 dstRule.m_bMatchOnce = pSrcRule->m_bMatchOnce;
2793 dstRule.m_bEnabled = pSrcRule->m_bEnabled;
2794 dstRule.m_bApplyContextToWorld = pSrcRule->m_bApplyContextToWorld;
2795
2796 // Copy off criteria.
2797 CopyCriteriaFrom( pSrcRule, &dstRule, pCustomSystem );
2798
2799 // Copy off responses.
2800 CopyResponsesFrom( pSrcRule, &dstRule, pCustomSystem );
2801
2802 // Copy off enumerations - Don't think we use these.
2803// CopyEnumerationsFrom( pCustomSystem );
2804
2805 // Add rule.
2806 pCustomSystem->m_Rules.Insert( m_Rules.GetElementName( iRule ), dstRule );
2807}
2808
2809//-----------------------------------------------------------------------------
2810// Purpose: A special purpose response system associated with a custom entity

Callers

nothing calls this directly

Calls 5

AssertFunction · 0.85
SetContextMethod · 0.45
GetContextMethod · 0.45
InsertMethod · 0.45
GetElementNameMethod · 0.45

Tested by

no test coverage detected