View Single Post
[email protected]
Member
Join Date: Dec 2005
Old 12-07-2005 , 12:25  
Reply With Quote #10

Well, I *think* I have CBaseEntity and its derived classes working. At least, I'm pretty sure I have all the virtual functions working. I used the list that Mani posted, and rewrote the files needed all the way up through CBasePlayer. The reason I'm pretty sure it's working good: in CBasePlayer one of the functions was changed to a virtual function: "CommitSuicide( )". I've been using that in my plugin with no problems. I've also tested a few random virtual functions from the other classes, and they work fine. I can't say as much for member variables and non-virtual functions. I've only tested a couple of those, but so far, they seem to be working. Heres what I had to do:

In baseentity.h:
- Added:
Code:
virtual bool CanBeHitByMeleeAttack( CBaseEntity * ) { return true; }
directly before
Code:
virtual int OnTakeDamage( const CTakeDamageInfo &info );
- Added:
Code:
virtual void Event_KilledOther( CBaseEntity *pEntity ) { }
directly after
Code:
virtual void Event_Killed( const CTakeDamageInfo &info );
- Added:
Code:
virtual bool SUB_AllowedToFade( ) { return false; }
directly after
Code:
virtual void StopLoopingSounds( void ) {}
In baseanimating.h:
- Added:
Code:
virtual void SetLightingOriginRelative( CBaseEntity *pLightingOrigin ) { SetLightingOrigin( pLightingOrigin ); }
directly before
Code:
virtual void SetLightingOrigin( CBaseEntity *pLightingOrigin );
In baseanimatingoverlay.h: No changes necessary, just added "virtual" to some of the functions that were inherited virtual, but didn't have it denoted as such.

In baseflex.h: No changes necessary, same as for baseanimatingoverlay.h

In basecombatcharacter.h
- Added
Code:
virtual void SetLightingOriginRelative( CBaseEntity *pLightingOrigin ) { SetLightingOrigin( pLightingOrigin ); }
directly before
Code:
virtual QAngle BodyAngles();
- Added
Code:
virtual bool CanBecomeServerRagdoll( ) { return true; }
directly after
Code:
virtual bool RemovePlayerItem( CBaseCombatWeapon *pItem ) { return false; }
- Added
Code:
virtual void FixupBurningServerRagdoll( CBaseEntity *pBase ) { }
directly after
Code:
virtual bool BecomeRagdoll( const CTakeDamageInfo &info, const Vector &forceVector );
- Added
Code:
virtual void PushawayTouch( CBaseEntity *pOther ) { }
directly before
Code:
virtual CBaseCombatCharacter MyCombatCharacterPointer( void ) { return this; }
- Removed
Code:
virtual bool CanPowerupNow( int iPowerup );
virtual bool CanPowerupEver( int iPowerup );
virtual float PowerupDuration( int iPowerup, float flTime );
virtual void PowerupStart( int iPowerup, float flAmount = 0, CBaseEntity *pAttacker = NULL, CDamageModifier *pDamageModifier = NULL );
virtual void PowerupEnd( int iPowerup );
In player.h:
- Added a forward declaration:
Code:
class autoaim_params_t;
- Added
Code:
virtual bool IsIlluminatedByFlashlight( ) { return false; }
directly after
Code:
virtual void FlashlightTurnOff( void ) { };
- Added
Code:
virtual void StartReplayMode( float fIDontKnow, float fIStillDontKnow, int iIDontKnowEither ) { }
virtual void StopReplayMode( ) { }
virtual int GetDelayTicks( ) { return 0; }
virtual CBaseEntity * GetReplayEntity( ) { return NULL; }
directly after
Code:
virtual void ResetObserverMode();
- Added
Code:
virtual Vector GetAutoaimVector( float fWhoKnows, autoaim_params_t &AgainWhoKnows ) { return ( GetAutoaimVector( fWhoKnows ); }
directly after
Code:
virtual Vector GetAutoaimVector( float flDelta  );
- Changed
Code:
void CommitSuicide();
to
Code:
virtual void CommitSuicide();
- Added
Code:
virtual int SpawnArmorValue( ) const { return 0; }
directly before
Code:
CNetworkVarForDerived( int, m_ArmorValue );
Now it should be noted that mose of the functions I added are just to add a space to the vtabes. I have no idea if the have the right return values, though it's pretty easy to guess on mose and they most certainly do not function correctly. Also, the functions that I removed might only have been changed from virtual to non-virtual, I really don't know.
Attached Files
File Type: zip cbaseplayer.zip (50.4 KB, 135 views)
Lojo.jacob@gmail.com is offline