| 17 | } |
| 18 | |
| 19 | void Tr2ActionPlaySound::Start( ITr2ActionController& controller ) |
| 20 | { |
| 21 | ITr2SoundEmitterOwnerPtr owner = BlueCastPtr( controller.GetOwner() ); |
| 22 | |
| 23 | if( !m_target.empty() ) |
| 24 | { |
| 25 | if( EveMultiEffectPtr multiEffect = BlueCastPtr( controller.GetOwner() ) ) |
| 26 | { |
| 27 | if( EveMultiEffectParameterPtr mep = multiEffect->GetParameterByName( m_target ) ) |
| 28 | { |
| 29 | owner = BlueCastPtr( mep->GetParameterObject() ); |
| 30 | } |
| 31 | } |
| 32 | else if( IEveEffectChildrenOwnerPtr childEffectOwner = BlueCastPtr( controller.GetOwner() ) ) |
| 33 | { |
| 34 | owner = BlueCastPtr( childEffectOwner->GetEffectChildByName( m_target.c_str() ) ); |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | if( owner != nullptr ) |
| 39 | { |
| 40 | if( auto emitter = owner->FindSoundEmitter( m_emitterName.c_str() ) ) |
| 41 | { |
| 42 | emitter->SendEvent( static_cast<const wchar_t*>( CA2W( m_soundEvent.c_str() ) ), m_bypassPrefix ); |
| 43 | } |
| 44 | } |
| 45 | else |
| 46 | { |
| 47 | CCP_LOGERR( "Tr2ActionPlaySound failed to find an owner! The target must be derived from ITr2SoundEmitterOwner." ); |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | void Tr2ActionPlaySound::StartWithController( PyObject* obj ) |
| 52 | { |
nothing calls this directly
no test coverage detected