ValveSoftware / source-sdk-2013

The 2013 edition of the Source SDK
https://developer.valvesoftware.com/wiki/SDK2013_GettingStarted
Other
3.84k stars 2.02k forks source link

Multiple Shell/Brass Ejections in Thirdperson #495

Open func-dave opened 4 years ago

func-dave commented 4 years ago

I've recently noticed default weapons tend to instantiate 2 to 3 shells per shot when using third-person. Everything seems fine in first-person. I'm not sure if this is being caused by EjectBrass case in c_baseanimating.cpp or by something with the model .qc files? Anyone else notice this issue?

// Eject brass
    case CL_EVENT_EJECTBRASS1:
        if ( m_Attachments.Count() > 0 )
        {
                        // May need to filter out local player from seeing duplicate eject brass events

            if ( MainViewOrigin().DistToSqr( GetAbsOrigin() ) < (256 * 256) )
            {
                Vector attachOrigin;
                QAngle attachAngles; 

                if( GetAttachment( 2, attachOrigin, attachAngles ) )
                {
                    tempents->EjectBrass( attachOrigin, attachAngles, GetAbsAngles(), atoi( options ) );
                }
            }
        }
        break;

Adding a link from VDC, it describes another possibility of what's causing the issue in the now defunct hl2mp_playeranimstate.cpp. Is the new method for animation having the same filtering issue for local players?

https://developer.valvesoftware.com/wiki/Duplicate_Animation_Events_Fix