| 66 | |
| 67 | |
| 68 | void Tr2ActionChildEffect::Start( ITr2ActionController& controller ) |
| 69 | { |
| 70 | IEveEffectChildrenOwnerPtr owner = BlueCastPtr( controller.GetOwner() ); |
| 71 | bool rebind = false; |
| 72 | |
| 73 | if( owner && !m_targetAnotherOwner.empty() ) |
| 74 | { |
| 75 | owner = BlueCastPtr( owner->GetEffectChildByName( m_targetAnotherOwner.c_str() ) ); |
| 76 | } |
| 77 | |
| 78 | if( !owner ) |
| 79 | { |
| 80 | if( !m_targetAnotherOwner.empty() ) |
| 81 | { |
| 82 | if( EveMultiEffectPtr multiEffect = BlueCastPtr( controller.GetOwner() ) ) |
| 83 | { |
| 84 | if( EveMultiEffectParameterPtr mep = multiEffect->GetParameterByName( m_targetAnotherOwner ) ) |
| 85 | { |
| 86 | owner = BlueCastPtr( mep->GetParameterObject() ); |
| 87 | } |
| 88 | } |
| 89 | else if( EveStretch3Ptr stretch3 = BlueCastPtr( controller.GetOwner() ) ) |
| 90 | { |
| 91 | if( m_targetAnotherOwner == BlueSharedString( "SourceSpaceObject" ) ) |
| 92 | { |
| 93 | IEveSpaceObject2Ptr source = stretch3->GetSourceSpaceObject(); |
| 94 | owner = BlueCastPtr( source ); |
| 95 | } |
| 96 | |
| 97 | if( m_targetAnotherOwner == BlueSharedString( "DestSpaceObject" ) ) |
| 98 | { |
| 99 | IEveSpaceObject2Ptr dest = stretch3->GetDestSpaceObject(); |
| 100 | owner = BlueCastPtr( dest ); |
| 101 | } |
| 102 | } |
| 103 | } |
| 104 | if( !owner ) |
| 105 | { |
| 106 | return; |
| 107 | } |
| 108 | rebind = true; |
| 109 | } |
| 110 | |
| 111 | m_child = nullptr; |
| 112 | if( !m_childName.empty() ) |
| 113 | { |
| 114 | m_child = owner->GetEffectChildByName( m_childName.c_str() ); |
| 115 | } |
| 116 | if( m_addOnStart && !m_child && !m_path.empty() ) |
| 117 | { |
| 118 | m_child = BeResMan->LoadObject<IEveSpaceObjectChild>( m_path.c_str() ); |
| 119 | if( m_child ) |
| 120 | { |
| 121 | if( !m_childName.empty() ) |
| 122 | { |
| 123 | m_child->SetName( m_childName.c_str() ); |
| 124 | } |
| 125 | owner->AddToEffectChildrenList( m_child ); |
nothing calls this directly
no test coverage detected