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

Method SetScriptValue

Code/CryEngine/CryMovie/ScriptVarNode.cpp:85–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83}
84
85void CAnimScriptVarNode::SetScriptValue()
86{
87 IScriptSystem* pScriptSystem = gEnv->pMovieSystem->GetSystem()->GetIScriptSystem();
88
89 if (!pScriptSystem)
90 {
91 return;
92 }
93
94 const char* sVarName = GetName();
95 const char* sPnt = strchr(sVarName, '.');
96
97 if (sPnt == 0)
98 {
99 // Global variable.
100 pScriptSystem->SetGlobalValue(sVarName, m_value);
101 }
102 else
103 {
104 char sTable[256];
105 char sName[256];
106 cry_strcpy(sTable, sVarName);
107 sTable[sPnt - sVarName] = 0;
108 cry_strcpy(sName, sPnt + 1);
109
110 // In Table value.
111 SmartScriptTable pTable;
112
113 if (pScriptSystem->GetGlobalValue(sTable, pTable))
114 {
115 // Set float value inside table.
116 pTable->SetValue(sName, m_value);
117 }
118 }
119}

Callers

nothing calls this directly

Calls 7

GetNameFunction · 0.85
cry_strcpyFunction · 0.85
SetGlobalValueMethod · 0.80
GetGlobalValueMethod · 0.80
GetIScriptSystemMethod · 0.45
GetSystemMethod · 0.45
SetValueMethod · 0.45

Tested by

no test coverage detected