MCPcopy Create free account
hub / github.com/StrongPC123/Far-Cry-1-Source-Full / GetThunk

Method GetThunk

CryCommon/_ScriptableEx.h:318–365  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

316 }
317
318 static int GetThunk(HSCRIPT h) {
319 static char cTemp[200];
320 m_pFunctionHandler->__Attach(h);
321 T *pThis=(T *)m_pFunctionHandler->GetThis();
322 const char *sIndex;
323 if(pThis && m_pFunctionHandler->GetParam(1,sIndex))
324 {
325
326 int nCookie;
327 USER_DATA nP;
328 if(_ScriptableEx<T>::m_pPropertiesTable->GetUDValue(sIndex,nP,nCookie))
329 {
330 Property *prop=((Property*)nP);
331 if(nCookie!=-1)
332 CryError("Scriptable EX:GetParam:GetUdValue");
333 assert(pThis->m_nBase);
334 void *val=(void *)(pThis->m_nBase+prop->val);
335 switch(prop->nType)
336 {
337 case PROPERTY_TYPE_INT:
338 return m_pFunctionHandler->EndFunction((*((int *)val)));
339 break;
340 case PROPERTY_TYPE_FLOAT:
341 return m_pFunctionHandler->EndFunction((*((float *)val)));
342 break;
343 case PROPERTY_TYPE_CHAR:
344 return m_pFunctionHandler->EndFunction((const char *)val);
345 break;
346 case PROPERTY_TYPE_STRING:{
347 return m_pFunctionHandler->EndFunction((*((string *)val)).c_str());
348 }
349 break;
350 case PROPERTY_TYPE_BOOL:
351 return m_pFunctionHandler->EndFunction((*((bool *)val)));
352 break;
353 case PROPERTY_TYPE_OBJECT:
354 return m_pFunctionHandler->EndFunction((((IScriptObject *)val)));
355 break;
356 default:
357 return -1;
358 break;
359 }
360
361 }
362 }
363 //returning -1 mean that the script engine must manage this property himself
364 return -1;
365 }
366
367
368 //PropertiesVec *m_pvPropertiesVector;

Callers

nothing calls this directly

Calls 7

CryErrorFunction · 0.85
__AttachMethod · 0.80
GetThisMethod · 0.80
EndFunctionMethod · 0.80
GetParamMethod · 0.45
GetUDValueMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected