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

Method SpawnEffect

CrySystem/ScriptObjectParticle.cpp:616–644  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

614
615//////////////////////////////////////////////////////////////////////////
616int CScriptObjectParticle::SpawnEffect(IFunctionHandler *pH)
617{
618 CScriptObjectVector oVec(m_pScriptSystem,true);
619 Vec3 pos,dir;
620 const char *sEffectName = 0;
621 float fScale = 1.0f;
622
623 if(!pH->GetParam(1,*oVec))
624 m_pScriptSystem->RaiseError( "<SpawnEffect> parameter 1 not specified or nil(pos)" );
625 pos = oVec.Get();
626 if(!pH->GetParam(2,*oVec))
627 m_pScriptSystem->RaiseError( "<SpawnEffect> parameter 2 not specified or nil(normal)" );
628 dir = oVec.Get();
629 if(!pH->GetParam(3,sEffectName))
630 m_pScriptSystem->RaiseError( "<SpawnEffect> parameter 3 not specified or nil(Effect Name)" );
631 // Optional argument for scale.
632// pH->GetParam(4,fScale);
633 if(pH->GetParamCount()>3)
634 pH->GetParam(4,fScale);
635
636 if (sEffectName)
637 {
638 IParticleEffect *pEffect = m_p3DEngine->FindParticleEffect( sEffectName );
639 if (pEffect)
640 pEffect->Spawn( pos,dir,fScale );
641 }
642
643 return pH->EndFunction();
644}

Callers

nothing calls this directly

Calls 7

RaiseErrorMethod · 0.80
FindParticleEffectMethod · 0.80
EndFunctionMethod · 0.80
GetParamMethod · 0.45
GetMethod · 0.45
GetParamCountMethod · 0.45
SpawnMethod · 0.45

Tested by

no test coverage detected