void CRopeKeyframe::SetParent( CBaseEntity *pNewParent, int iAttachment ) { CBaseEntity *pCurParent = GetMoveParent(); if ( pCurParent ) { pCurParent->DecrementTransmitStateOwnedCounter(); pCurParent->DispatchUpdateTransmitState(); } // Make sure our move parent always transmits or we get asserts on the client. if ( pNewParent ) { pNewParent->IncrementTransmitStateOwnedCounter(); pNewParent->SetTransmitState( FL_EDICT_ALWAYS ); } BaseClass::SetParent( pNewParent, iAttachment ); }
void CRopeKeyframe::SetAttachmentPoint( CBaseHandle &hOutEnt, short &iOutAttachment, CBaseEntity *pEnt, int iAttachment ) { // Unforce our previously attached entity from transmitting. CBaseEntity *pCurEnt = gEntList.GetBaseEntity( hOutEnt ); if ( pCurEnt && pCurEnt->edict() ) { pCurEnt->DecrementTransmitStateOwnedCounter(); pCurEnt->DispatchUpdateTransmitState(); } hOutEnt = pEnt; iOutAttachment = iAttachment; // Force this entity to transmit. if ( pEnt ) { pEnt->SetTransmitState( FL_EDICT_ALWAYS ); pEnt->IncrementTransmitStateOwnedCounter(); } EndpointsChanged(); }