/////////////////////////////////////////////////////////////////////
| 614 | |
| 615 | ////////////////////////////////////////////////////////////////////////// |
| 616 | int 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 | } |
nothing calls this directly
no test coverage detected