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

Method SendScriptEvent

CryEntitySystem/Entity.cpp:2516–2554  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2514
2515
2516void CEntity::SendScriptEvent(enum EScriptEventId Event, IScriptObject *pParamters, bool *pRet)
2517{
2518 // Server side always first.
2519 bool bClientReturn=true;
2520 if (m_pServerState && m_pServerState->pFunction[ScriptState_OnEvent])
2521 {
2522 m_pScriptSystem->BeginCall(m_pServerState->pFunction[ScriptState_OnEvent]);
2523 m_pScriptSystem->PushFuncParam(m_pScriptObject);
2524 m_pScriptSystem->PushFuncParam((int)Event);
2525 if (pParamters)
2526 m_pScriptSystem->PushFuncParam(pParamters);
2527 else
2528 m_pScriptSystem->PushFuncParam(false);
2529 if (pRet){
2530 m_pScriptSystem->EndCall(*pRet);
2531 }
2532 else
2533 m_pScriptSystem->EndCall();
2534 // Only use return value if we ain't got a server event
2535 bClientReturn=false;
2536 }
2537 // Client side always second.
2538 if (m_pClientState && m_pClientState->pFunction[ScriptState_OnEvent])
2539 {
2540 m_pScriptSystem->BeginCall(m_pClientState->pFunction[ScriptState_OnEvent]);
2541 m_pScriptSystem->PushFuncParam(m_pScriptObject);
2542 m_pScriptSystem->PushFuncParam((int)Event);
2543 if (pParamters)
2544 m_pScriptSystem->PushFuncParam(pParamters);
2545 else
2546 m_pScriptSystem->PushFuncParam(false);
2547
2548 // Only use return value if we ain't got a server event
2549 if (pRet && bClientReturn)
2550 m_pScriptSystem->EndCall(*pRet);
2551 else
2552 m_pScriptSystem->EndCall();
2553 }
2554}
2555
2556void CEntity::SendScriptEvent(enum EScriptEventId Event, const char *str, bool *pRet )
2557{

Callers 15

ResetEntitiesMethod · 0.80
OnAnimationEventMethod · 0.80
SetWeaponUserMethod · 0.80
ReleaseWeaponUserMethod · 0.80
AIMindMethod · 0.80
FindObjectOfTypeMethod · 0.80
SwitchFlashLightMethod · 0.80
AnimateUsersMethod · 0.80
CreateExplosionMethod · 0.80
UpdateMethod · 0.80
SetEntityPropertiesMethod · 0.80

Calls 3

BeginCallMethod · 0.80
PushFuncParamMethod · 0.80
EndCallMethod · 0.45

Tested by

no test coverage detected