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

Method GotoState

CrySystem/ScriptObjectEntity.cpp:3224–3243  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

3222
3223//////////////////////////////////////////////////////////////////////////
3224int CScriptObjectEntity::GotoState(IFunctionHandler *pH)
3225{
3226 CHECK_PARAMETERS(1);
3227
3228 const char *sState;
3229 pH->GetParam(1,sState);
3230
3231 bool res = false;
3232 if (sState)
3233 {
3234 if(!m_pEntity->IsStateClientside() && !GetISystem()->GetIGame()->GetModuleState( EGameServer ))
3235 {
3236 // GotoState should only be called on the client when StateClientSide is on for this entity
3237 CryLog("\001ERROR: ScriptObjectEntity:GotoState on the client! (EntityClass:'%s' Name:'%s', State:'%s')",
3238 m_pEntity->GetEntityClassName(), m_pEntity->GetName(), sState);
3239 }
3240 res = m_pEntity->GotoState(sState);
3241 }
3242 return pH->EndFunction(res);
3243}
3244
3245//////////////////////////////////////////////////////////////////////////
3246int CScriptObjectEntity::IsInState(IFunctionHandler *pH)

Callers

nothing calls this directly

Calls 9

CryLogFunction · 0.85
IsStateClientsideMethod · 0.80
GetModuleStateMethod · 0.80
EndFunctionMethod · 0.80
GetISystemFunction · 0.70
GetParamMethod · 0.45
GetIGameMethod · 0.45
GetEntityClassNameMethod · 0.45
GetNameMethod · 0.45

Tested by

no test coverage detected