Merge pull request #266 from rlenhub/develop

Implement "OnPhysGunPull" output in CPhysicsProp
This commit is contained in:
Blixibon 2025-01-02 08:26:35 -06:00 committed by GitHub
commit 72bd5fe948
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 15 additions and 0 deletions

View File

@ -2723,6 +2723,11 @@ CWeaponPhysCannon::FindObjectResult_t CWeaponPhysCannon::FindObject( void )
pullDir *= (mass + 0.5) * (1/50.0f);
}
CPhysicsProp* pProp = dynamic_cast<CPhysicsProp*>(pObj);
if (pProp) {
pProp->OnPhysGunPull( pOwner );
}
// Nudge it towards us
pObj->ApplyForceCenter( pullDir );
return OBJECT_NOT_FOUND;

View File

@ -3021,6 +3021,7 @@ BEGIN_DATADESC( CPhysicsProp )
DEFINE_OUTPUT( m_MotionEnabled, "OnMotionEnabled" ),
DEFINE_OUTPUT( m_OnPhysGunPickup, "OnPhysGunPickup" ),
DEFINE_OUTPUT( m_OnPhysGunOnlyPickup, "OnPhysGunOnlyPickup" ),
DEFINE_OUTPUT( m_OnPhysGunPull, "OnPhysGunPull" ),
DEFINE_OUTPUT( m_OnPhysGunPunt, "OnPhysGunPunt" ),
DEFINE_OUTPUT( m_OnPhysGunDrop, "OnPhysGunDrop" ),
DEFINE_OUTPUT( m_OnPlayerUse, "OnPlayerUse" ),
@ -3391,6 +3392,13 @@ void CPhysicsProp::OnPhysGunPickup( CBasePlayer *pPhysGunUser, PhysGunPickup_t r
CheckRemoveRagdolls();
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CPhysicsProp::OnPhysGunPull( CBasePlayer* pPhysGunUser ) {
m_OnPhysGunPull.FireOutput(pPhysGunUser, this);
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------

View File

@ -413,6 +413,7 @@ public:
void EnableMotion( void );
bool CanBePickedUpByPhyscannon( void );
void OnPhysGunPickup( CBasePlayer *pPhysGunUser, PhysGunPickup_t reason );
void OnPhysGunPull( CBasePlayer *pPhysGunUser );
void OnPhysGunDrop( CBasePlayer *pPhysGunUser, PhysGunDrop_t reason );
bool GetPropDataAngles( const char *pKeyName, QAngle &vecAngles );
@ -446,6 +447,7 @@ private:
COutputEvent m_OnPhysGunPickup;
COutputEvent m_OnPhysGunPunt;
COutputEvent m_OnPhysGunOnlyPickup;
COutputEvent m_OnPhysGunPull;
COutputEvent m_OnPhysGunDrop;
COutputEvent m_OnPlayerUse;
COutputEvent m_OnPlayerPickup;