MCPcopy Create free account
hub / github.com/MergHQ/CRYENGINE / BeginPreCachedBuffer

Method BeginPreCachedBuffer

Code/CryEngine/CryScriptSystem/ScriptSystem.cpp:2694–2723  ·  view source on GitHub ↗

/////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

2692
2693//////////////////////////////////////////////////////////////////////////
2694int CScriptSystem::BeginPreCachedBuffer(int iIndex)
2695{
2696 assert(iIndex >= 0);
2697
2698 int iRet = 0;
2699
2700 if (iIndex >= 0 && iIndex < (int)m_vecPreCached.size())
2701 {
2702 ScriptAnyValue ScriptFunction;
2703 m_pPreCacheBufferTable->GetAtAny(iIndex, ScriptFunction);
2704
2705 if (ScriptFunction.GetVarType() == svtFunction)
2706 {
2707 iRet = BeginCall(ScriptFunction.function);
2708 }
2709
2710 if (iRet == 0)
2711 {
2712 GetISystem()->Warning(VALIDATOR_MODULE_SCRIPTSYSTEM, VALIDATOR_WARNING, VALIDATOR_FLAG_FILE | VALIDATOR_FLAG_SCRIPT, "Precached",
2713 "[Lua] Error executing: [%s]", m_vecPreCached[iIndex].c_str());
2714 }
2715 }
2716 else
2717 {
2718 GetISystem()->Warning(VALIDATOR_MODULE_SCRIPTSYSTEM, VALIDATOR_WARNING, VALIDATOR_FLAG_FILE | VALIDATOR_FLAG_SCRIPT, "Precached",
2719 "[Lua] Precached buffer %d does not exist (last valid is %d)", iIndex, m_vecPreCached.size());
2720 }
2721
2722 return (iRet);
2723}
2724
2725//////////////////////////////////////////////////////////////////////////
2726void CScriptSystem::ClearPreCachedBuffer()

Callers

nothing calls this directly

Calls 6

GetISystemFunction · 0.85
GetAtAnyMethod · 0.80
GetVarTypeMethod · 0.80
sizeMethod · 0.45
WarningMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected