-------------------------------------------------------------------------------- Description: Sets the target object. This is part of the targetObject property. --------------------------------------------------------------------------------
| 3734 | // Sets the target object. This is part of the targetObject property. |
| 3735 | // -------------------------------------------------------------------------------- |
| 3736 | void EveTurretSet::SetTargetObject( IRoot* target ) |
| 3737 | { |
| 3738 | if( !target ) |
| 3739 | { |
| 3740 | return; |
| 3741 | } |
| 3742 | ITriTargetablePtr oldTargetPtr = m_target->GetTargetable(); |
| 3743 | |
| 3744 | // attach to target |
| 3745 | m_target->SetTargetable( target ); |
| 3746 | |
| 3747 | if( m_playMovementSound && !m_idleToTargetingMovementAudioEvent.empty() ) |
| 3748 | { |
| 3749 | // Always trigger movement sounds if coming from IDLE state, otherwise trigger it only if you're targeting a new object. |
| 3750 | if( m_state == STATE_IDLE || !oldTargetPtr.IsEqualObject( m_target->GetTargetable() ) ) |
| 3751 | { |
| 3752 | SendEventToAudEmitter( m_turretMovementObserver, m_idleToTargetingMovementAudioEvent ); |
| 3753 | } |
| 3754 | } |
| 3755 | |
| 3756 | // update the firing effect we have one |
| 3757 | SetTargetScale(); |
| 3758 | } |
| 3759 | |
| 3760 | // -------------------------------------------------------------------------------- |
| 3761 | // Description: |
nothing calls this directly
no test coverage detected