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

Method SynchedNewIndexFunction

Code/CryEngine/CryAction/Network/ScriptRMI.cpp:1117–1149  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1115}
1116
1117int CScriptRMI::SynchedNewIndexFunction(IFunctionHandler* pH)
1118{
1119 if (!m_pThis->m_pParent)
1120 {
1121 pH->GetIScriptSystem()->RaiseError("Trying to set a synchronized variable with no game started... failing");
1122 return pH->EndFunction();
1123 }
1124
1125 SmartScriptTable table;
1126 SmartScriptTable hidden;
1127 const char* key;
1128 ScriptAnyValue value;
1129
1130 if (!pH->GetParam(1, table))
1131 return pH->EndFunction(false);
1132
1133 ScriptHandle id;
1134 if (!table->GetValue(ID_FIELD, id))
1135 return pH->EndFunction(false);
1136 if (!table->GetValue(HIDDEN_FIELD, hidden))
1137 return pH->EndFunction(false);
1138
1139 if (!pH->GetParam(2, key))
1140 return pH->EndFunction(false);
1141 if (!pH->GetParamAny(3, value))
1142 return pH->EndFunction(false);
1143
1144 hidden->SetValueAny(key, value);
1145
1146 m_pThis->m_pParent->ChangedScript((EntityId) id.n);
1147
1148 return pH->EndFunction(true);
1149}
1150
1151void CScriptRMI::GetMemoryStatistics(ICrySizer* s)
1152{

Callers

nothing calls this directly

Calls 8

RaiseErrorMethod · 0.80
GetParamAnyMethod · 0.80
SetValueAnyMethod · 0.80
ChangedScriptMethod · 0.80
GetIScriptSystemMethod · 0.45
EndFunctionMethod · 0.45
GetParamMethod · 0.45
GetValueMethod · 0.45

Tested by

no test coverage detected