Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

661 lines
19 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: Player for HL1.
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef DOD_PLAYER_H
  8. #define DOD_PLAYER_H
  9. #pragma once
  10. #include "basemultiplayerplayer.h"
  11. #include "server_class.h"
  12. #include "dod_playeranimstate.h"
  13. #include "dod_shareddefs.h"
  14. #include "dod_player_shared.h"
  15. #include "unisignals.h"
  16. #include "dod_statmgr.h"
  17. #include "utlmap.h"
  18. #include "steam/steam_gameserver.h"
  19. #include "hintsystem.h"
  20. // Function table for each player state.
  21. class CDODPlayerStateInfo
  22. {
  23. public:
  24. DODPlayerState m_iPlayerState;
  25. const char *m_pStateName;
  26. void (CDODPlayer::*pfnEnterState)(); // Init and deinit the state.
  27. void (CDODPlayer::*pfnLeaveState)();
  28. void (CDODPlayer::*pfnPreThink)(); // Do a PreThink() in this state.
  29. };
  30. class CDODPlayer;
  31. //=======================================
  32. //Record of either damage taken or given.
  33. //Contains the player name that we hurt or that hurt us,
  34. //and the total damage
  35. //=======================================
  36. class CDamageRecord
  37. {
  38. public:
  39. CDamageRecord( const char *pszName, int iLifeID, int iDamage )
  40. {
  41. Q_strncpy( m_szPlayerName, pszName, MAX_PLAYER_NAME_LENGTH );
  42. m_iDamage = iDamage;
  43. m_iNumHits = 1;
  44. m_iLifeID = iLifeID;
  45. }
  46. void AddDamage( int iDamage )
  47. {
  48. m_iDamage += iDamage;
  49. m_iNumHits++;
  50. }
  51. char *GetPlayerName( void ) { return m_szPlayerName; }
  52. int GetDamage( void ) { return m_iDamage; }
  53. int GetNumHits( void ) { return m_iNumHits; }
  54. int GetLifeID( void ) { return m_iLifeID; }
  55. private:
  56. char m_szPlayerName[MAX_PLAYER_NAME_LENGTH];
  57. int m_iLifeID; // life ID of the player when this damage was done
  58. int m_iDamage; //how much damage was done
  59. int m_iNumHits; //how many hits
  60. };
  61. #define SIGNAL_CAPTUREAREA (1<<0)
  62. class CDODBombTarget;
  63. class CDODPlayerStatProperty
  64. {
  65. DECLARE_CLASS_NOBASE( CDODPlayerStatProperty );
  66. public:
  67. CDODPlayerStatProperty()
  68. {
  69. m_iCurrentLifePlayerClass = -1;
  70. m_bRecordingStats = false;
  71. ResetPerLifeStats();
  72. }
  73. ~CDODPlayerStatProperty() {}
  74. void SetClassAndTeamForThisLife( int iPlayerClass, int iTeam );
  75. void IncrementPlayerClassStat( DODStatType_t statType, int iValue = 1 );
  76. void IncrementWeaponStat( DODWeaponID iWeaponID, DODStatType_t statType, int iValue = 1 );
  77. // reset per life stats
  78. void ResetPerLifeStats( void );
  79. // send this life's worth of data to the client
  80. void SendStatsToPlayer( CDODPlayer *pPlayer );
  81. private:
  82. bool m_bRecordingStats; // not recording until we get a valid class. stop recording when we join spectator
  83. int m_iCurrentLifePlayerClass;
  84. int m_iCurrentLifePlayerTeam;
  85. // single life's worth of player stats
  86. dod_stat_accumulator_t m_PlayerStatsPerLife;
  87. // single life's worth of weapon stats
  88. dod_stat_accumulator_t m_WeaponStatsPerLife[WEAPON_MAX];
  89. bool m_bWeaponStatsDirty[WEAPON_MAX];
  90. };
  91. //=============================================================================
  92. // >> Day of Defeat player
  93. //=============================================================================
  94. class CDODPlayer : public CBaseMultiplayerPlayer
  95. {
  96. public:
  97. DECLARE_CLASS( CDODPlayer, CBaseMultiplayerPlayer );
  98. DECLARE_SERVERCLASS();
  99. DECLARE_DATADESC();
  100. CDODPlayer();
  101. ~CDODPlayer();
  102. static CDODPlayer *CreatePlayer( const char *className, edict_t *ed );
  103. static CDODPlayer* Instance( int iEnt );
  104. // This passes the event to the client's and server's CPlayerAnimState.
  105. void DoAnimationEvent( PlayerAnimEvent_t event, int nData = 0 );
  106. void SetupBones( matrix3x4_t *pBoneToWorld, int boneMask );
  107. virtual void Precache();
  108. void PrecachePlayerModel( const char *szPlayerModel );
  109. virtual void Spawn();
  110. virtual void InitialSpawn( void );
  111. virtual void CheatImpulseCommands( int iImpulse );
  112. virtual void PlayerRunCommand( CUserCmd *ucmd, IMoveHelper *moveHelper );
  113. virtual void PreThink();
  114. virtual void PostThink();
  115. virtual int OnTakeDamage( const CTakeDamageInfo &inputInfo );
  116. virtual int OnTakeDamage_Alive( const CTakeDamageInfo &info );
  117. virtual void Event_Killed( const CTakeDamageInfo &info );
  118. virtual void TraceAttack( const CTakeDamageInfo &info, const Vector &vecDir, trace_t *ptr, CDmgAccumulator *pAccumulator );
  119. void Pain( void );
  120. void OnDamagedByExplosion( const CTakeDamageInfo &info );
  121. void OnDamageByStun( const CTakeDamageInfo &info );
  122. void DeafenThink( void );
  123. virtual void UpdateGeigerCounter( void ) {}
  124. virtual void CheckTrainUpdate( void ) {}
  125. virtual void CreateViewModel( int viewmodelindex = 0 );
  126. virtual bool SetObserverMode(int mode); // sets new observer mode, returns true if successful
  127. virtual bool ModeWantsSpectatorGUI( int iMode ) { return ( iMode != OBS_MODE_DEATHCAM && iMode != OBS_MODE_FREEZECAM ); }
  128. // from CBasePlayer
  129. void SetupVisibility( CBaseEntity *pViewEntity, unsigned char *pvs, int pvssize );
  130. CBaseEntity* EntSelectSpawnPoint();
  131. void ChangeTeam( int iTeamNum );
  132. bool CanMove( void ) const;
  133. virtual void SharedSpawn();
  134. void CheckProneMoveSound( int groundspeed, bool onground );
  135. virtual void UpdateStepSound( surfacedata_t *psurface, const Vector &vecOrigin, const Vector &vecVelocity );
  136. virtual void PlayStepSound( Vector &vecOrigin, surfacedata_t *psurface, float fvol, bool force );
  137. virtual const Vector GetPlayerMins( void ) const; // uses local player
  138. virtual const Vector GetPlayerMaxs( void ) const; // uses local player
  139. void DODRespawn( void );
  140. virtual void SetAnimation( PLAYER_ANIM playerAnim );
  141. CBaseEntity * GiveNamedItem( const char *pszName, int iSubType = 0 );
  142. bool Weapon_CanSwitchTo( CBaseCombatWeapon *pWeapon );
  143. void SetScore( int score );
  144. void AddScore( int num );
  145. int GetScore( void ) { return m_iScore; }
  146. int m_iScore;
  147. // Simulates a single frame of movement for a player
  148. void RunPlayerMove( const QAngle& viewangles, float forwardmove, float sidemove, float upmove, unsigned short buttons, byte impulse, float frametime );
  149. //Damage record functions
  150. void RecordDamageTaken( CDODPlayer *pAttacker, int iDamageTaken );
  151. void RecordWorldDamageTaken( int iDamageTaken );
  152. void RecordDamageGiven( CDODPlayer *pVictim, int iDamageGiven );
  153. void ResetDamageCounters(); //Reset all lists
  154. void OutputDamageTaken( void );
  155. void OutputDamageGiven( void );
  156. // Voice Commands
  157. //============
  158. void HandleCommand_Voice( const char *pcmd ); // player submitted a raw voice_ command
  159. void HandleCommand_HandSignal( const char *pcmd ); // player wants to show a hand signal
  160. void VoiceCommand( int iVoiceCommand ); // internal voice command function
  161. void HandSignal( int iSignal ); // same for hand signals
  162. float m_flNextVoice;
  163. float m_flNextHandSignal;
  164. void PopHelmet( Vector vecDir, Vector vecForceOrigin );
  165. bool DropActiveWeapon( void );
  166. bool DropPrimaryWeapon( void );
  167. bool DODWeaponDrop( CBaseCombatWeapon *pWeapon, bool bThrowForward );
  168. bool BumpWeapon( CBaseCombatWeapon *pBaseWeapon );
  169. CWeaponDODBase* GetActiveDODWeapon() const;
  170. virtual void AttemptToExitFreezeCam( void );
  171. //Generic Ammo
  172. //============
  173. void DropGenericAmmo( void );
  174. void ReturnGenericAmmo( void );
  175. bool GiveGenericAmmo( void );
  176. bool m_bHasGenericAmmo;
  177. void ResetBleeding( void );
  178. void Bandage( void ); // stops the bleeding
  179. void SetBandager( CDODPlayer *pPlayer );
  180. bool IsBeingBandaged( void );
  181. EHANDLE m_hBandager;
  182. //Area Signals
  183. //============
  184. //to determine if the player is in a sandbag trigger
  185. CUnifiedSignals m_signals; // Player signals (buy zone, bomb zone, etc.)
  186. int m_iCapAreaIconIndex; //which area's icon to show - we are not necessarily capping it.
  187. int m_iObjectAreaIndex; //if the player is in an object cap area, which one?
  188. void SetCapAreaIndex( int index );
  189. int GetCapAreaIndex( void );
  190. void ClearCapAreaIndex() { SetCapAreaIndex(-1); }
  191. void SetCPIndex( int index );
  192. float m_fHandleSignalsTime; //time to next check the area signals
  193. void HandleSignals( void ); //check if signals need to do anything, like turn icons on or off
  194. bool ShouldAutoReload( void ) { return m_bAutoReload; }
  195. void SetAutoReload( bool bAutoReload ) { m_bAutoReload = bAutoReload; }
  196. bool ShouldAutoRezoom( void ) { return m_bAutoRezoom; }
  197. void SetAutoRezoom( bool bAutoRezoom ) { m_bAutoRezoom = bAutoRezoom; }
  198. // Hints
  199. virtual CHintSystem *Hints( void ) { return &m_Hints; }
  200. // Reset all scores
  201. void ResetScores( void );
  202. int GetHealthAsString( char *pDest, int iDestSize );
  203. int GetLastPlayerIDAsString( char *pDest, int iDestSize );
  204. int GetClosestPlayerHealthAsString( char *pDest, int iDestSize );
  205. int GetPlayerClassAsString( char *pDest, int iDestSize );
  206. int GetNearestLocationAsString( char *pDest, int iDestSize );
  207. int GetTimeleftAsString( char *pDest, int iDestSize );
  208. int GetStringForEscapeSequence( char c, char *pDest, int iDestSize );
  209. virtual void CheckChatText( char *p, int bufsize );
  210. void PushawayThink();
  211. void DestroyRagdoll( void );
  212. virtual bool CanHearChatFrom( CBasePlayer *pPlayer );
  213. virtual void CommitSuicide( bool bExplode = false, bool bForce = false );
  214. virtual void CommitSuicide( const Vector &vecForce, bool bExplode = false, bool bForce = false );
  215. virtual bool StartReplayMode( float fDelay, float fDuration, int iEntity );
  216. virtual void StopReplayMode();
  217. void PickUpWeapon( CWeaponDODBase *pWeapon );
  218. int GetPriorityForPickUpEnt( CBaseEntity *pEnt );
  219. virtual CBaseEntity *FindUseEntity();
  220. virtual void ComputeWorldSpaceSurroundingBox( Vector *pVecWorldMins, Vector *pVecWorldMaxs );
  221. bool ShouldCollide( int collisionGroup, int contentsMask ) const;
  222. void SetDeathFlags( int iDeathFlags ) { m_iDeathFlags = iDeathFlags; }
  223. int GetDeathFlags() { return m_iDeathFlags; }
  224. void RemoveNemesisRelationships();
  225. virtual void OnAchievementEarned( int iAchievement );
  226. void RecalculateAchievementAwardsMask();
  227. bool ShouldInstantRespawn( void );
  228. void StatEvent_UploadStats( void );
  229. void StatEvent_KilledPlayer( DODWeaponID iKillingWeapon );
  230. void StatEvent_WasKilled( void );
  231. void StatEvent_RoundWin( void );
  232. void StatEvent_RoundLoss( void );
  233. void StatEvent_PointCaptured( void );
  234. void StatEvent_CaptureBlocked( void );
  235. void StatEvent_BombPlanted( void );
  236. void StatEvent_BombDefused( void );
  237. void StatEvent_ScoredDomination( void );
  238. void StatEvent_ScoredRevenge( void );
  239. void StatEvent_WeaponFired( DODWeaponID iWeaponID );
  240. void StatEvent_WeaponHit( DODWeaponID iWeaponID, bool bWasHeadshot );
  241. // ------------------------------------------------------------------------------------------------ //
  242. // Player state management.
  243. // ------------------------------------------------------------------------------------------------ //
  244. public:
  245. void State_Transition( DODPlayerState newState );
  246. DODPlayerState State_Get() const; // Get the current state.
  247. void MoveToNextIntroCamera(); //Cycle view through available intro cameras
  248. bool ClientCommand( const CCommand &args );
  249. virtual bool IsReadyToPlay( void );
  250. void FireBullets( const FireBulletsInfo_t &info );
  251. bool CanAttack( void );
  252. void SetBazookaDeployed( bool bDeployed ) { m_bBazookaDeployed = bDeployed; }
  253. // from cbasecombatcharacter
  254. virtual void InitVCollision( const Vector &vecAbsOrigin, const Vector &vecAbsVelocity );
  255. virtual void VPhysicsShadowUpdate( IPhysicsObject *pPhysics );
  256. void DeathSound( const CTakeDamageInfo &info );
  257. Activity TranslateActivity( Activity baseAct, bool *pRequired = NULL );
  258. CNetworkVar( float, m_flStunDuration );
  259. CNetworkVar( float, m_flStunMaxAlpha );
  260. // Stats Functions
  261. void Stats_WeaponFired( int weaponID );
  262. void Stats_WeaponHit( CDODPlayer *pVictim, int weaponID, int iDamage, int iDamageGiven, int hitgroup, float flHitDistance );
  263. void Stats_HitByWeapon( CDODPlayer *pAttacker, int weaponID, int iDamage, int iDamageGiven, int hitgroup );
  264. void Stats_KilledPlayer( CDODPlayer *pVictim, int weaponID );
  265. void Stats_KilledByPlayer( CDODPlayer *pAttacker, int weaponID );
  266. void Stats_AreaDefended( void );
  267. void Stats_AreaCaptured( void );
  268. void Stats_BonusRoundKill( void );
  269. void Stats_BombDetonated( void );
  270. void PrintLifetimeStats( void );
  271. // Called whenever this player fires a shot.
  272. void NoteWeaponFired();
  273. virtual bool WantsLagCompensationOnEntity( const CBasePlayer *pPlayer, const CUserCmd *pCmd, const CBitVec<MAX_EDICTS> *pEntityTransmitBits ) const;
  274. void TallyLatestTimePlayedPerClass( int iOldTeam, int iOldClass );
  275. void ResetProgressBar( void );
  276. void SetProgressBarTime( int barTime );
  277. void StoreCaptureBlock( int iAreaIndex, int iCapAttempt );
  278. int GetLastBlockCapAttempt( void );
  279. int GetLastBlockAreaIndex( void );
  280. public:
  281. CNetworkVarEmbedded( CDODPlayerShared, m_Shared );
  282. int m_flNextTimeCheck; // Next time the player can execute a "timeleft" command
  283. Vector m_lastStandingPos; // used by the gamemovement code for finding ladders
  284. void SetSprinting( bool bIsSprinting );
  285. void SetDefusing( CDODBombTarget *pTarget );
  286. bool m_bIsDefusing;
  287. CHandle<CDODBombTarget> m_pDefuseTarget;
  288. void SetPlanting( CDODBombTarget *pTarget );
  289. bool m_bIsPlanting;
  290. CHandle<CDODBombTarget> m_pPlantTarget;
  291. // Achievements
  292. void HandleHeadshotAchievement( int iNumHeadshots );
  293. void HandleDeployedMGKillCount( int iNumDeployedKills );
  294. int GetDeployedKillStreak( void );
  295. void HandleEnemyWeaponsAchievement( int iNumEnemyWpnKills );
  296. void ResetComboWeaponKill( void );
  297. void HandleComboWeaponKill( int iWeaponType );
  298. virtual void PlayUseDenySound();
  299. int iNumKilledByUnanswered[MAX_PLAYERS+1]; // how many unanswered kills this player has been dealt by every other player
  300. #if !defined(NO_STEAM)
  301. STEAM_GAMESERVER_CALLBACK( CDODPlayer, OnGSStatsReceived, GSStatsReceived_t, m_CallbackGSStatsReceived );
  302. #endif
  303. private:
  304. bool SelectSpawnSpot( const char *pEntClassName, CBaseEntity* &pSpot );
  305. CBaseEntity *SelectSpawnSpot( CUtlVector<EHANDLE> *pSpawnPoints, int &iLastSpawnIndex );
  306. // Copyed from EyeAngles() so we can send it to the client.
  307. CNetworkQAngle( m_angEyeAngles );
  308. IDODPlayerAnimState *m_PlayerAnimState;
  309. int FlashlightIsOn( void );
  310. void FlashlightTurnOn( void );
  311. void FlashlightTurnOff( void );
  312. void ShowClassSelectMenu();
  313. void CheckRotateIntroCam( void );
  314. void State_Enter( DODPlayerState newState ); // Initialize the new state.
  315. void State_Leave(); // Cleanup the previous state.
  316. void State_PreThink(); // Update the current state.
  317. // Specific state handler functions.
  318. void State_Enter_WELCOME();
  319. void State_PreThink_WELCOME();
  320. void State_Enter_PICKINGTEAM();
  321. void State_Enter_PICKINGCLASS();
  322. void State_PreThink_PICKING();
  323. void State_Enter_ACTIVE();
  324. void State_PreThink_ACTIVE();
  325. void State_Enter_OBSERVER_MODE();
  326. void State_PreThink_OBSERVER_MODE();
  327. void State_Enter_DEATH_ANIM();
  328. void State_PreThink_DEATH_ANIM();
  329. virtual void PlayerDeathThink();
  330. // When the player joins, it cycles their view between trigger_camera entities.
  331. // This is the current camera, and the time that we'll switch to the next one.
  332. EHANDLE m_pIntroCamera;
  333. float m_fIntroCamTime;
  334. // Find the state info for the specified state.
  335. static CDODPlayerStateInfo* State_LookupInfo( DODPlayerState state );
  336. // This tells us which state the player is currently in (joining, observer, dying, etc).
  337. // Each state has a well-defined set of parameters that go with it (ie: observer is movetype_noclip, non-solid,
  338. // invisible, etc).
  339. CNetworkVar( DODPlayerState, m_iPlayerState );
  340. // Tracks our ragdoll entity.
  341. CNetworkHandle( CBaseEntity, m_hRagdoll ); // networked entity handle
  342. float m_flLastMovement; // Time the player last moved, used for mp_autokick
  343. void InitProne( void );
  344. void InitSprinting( void );
  345. bool IsSprinting( void );
  346. bool CanSprint( void );
  347. int m_iDeathFlags; // death notice flags related to domination/revenge
  348. CNetworkVar( int, m_iAchievementAwardsMask );
  349. protected:
  350. void CreateRagdollEntity();
  351. void PhysObjectSleep();
  352. void PhysObjectWake();
  353. private:
  354. friend void Bot_Think( CDODPlayer *pBot ); // needs to use the HandleCommand_ stuff.
  355. bool HandleCommand_JoinTeam( int iTeam );
  356. bool HandleCommand_JoinClass( int iClass );
  357. CDODPlayerStateInfo *m_pCurStateInfo; // This can be NULL if no state info is defined for m_iPlayerState.
  358. bool m_bTeamChanged; //have we changed teams this spawn? Used to enforce one team switch per death rule
  359. float m_flNextStaminaThink; //time to do next stamina gain
  360. CNetworkVar( float, m_flStamina ); //stamina for sprinting, jumping etc
  361. Vector m_vecTotalBulletForce; //Accumulator for bullet force in a single frame
  362. bool m_bBazookaDeployed;
  363. //A list of damage given
  364. CUtlLinkedList< CDamageRecord *, int > m_DamageGivenList;
  365. //A list of damage taken
  366. CUtlLinkedList< CDamageRecord *, int > m_DamageTakenList;
  367. bool m_bSlowedByHit;
  368. float m_flUnslowTime;
  369. int m_iPlayerSpeed; //last updated player max speed
  370. bool SetSpeed( int speed );
  371. bool m_bAutoReload; // does the player want to autoreload their weapon when empty
  372. bool m_bAutoRezoom; // does the player want to re-zoom after each shot for sniper rifles and bazookas
  373. float m_flIdleTime; // next time we should do a deep idle
  374. bool m_bIsSprinting;
  375. CNetworkVar( bool, m_bSpawnInterpCounter );
  376. CHintSystem m_Hints;
  377. float m_flMinNextStepSoundTime;
  378. int m_LastHitGroup; // the last body region that took damage
  379. int m_LastDamageType; // the type of damage we last took
  380. bool m_bPlayingProneMoveSound;
  381. int m_iCapAreaIndex;
  382. // Last usercmd we shot a bullet on.
  383. int m_iLastWeaponFireUsercmd;
  384. CNetworkVar( float, m_flProgressBarStartTime );
  385. CNetworkVar( int, m_iProgressBarDuration );
  386. // blocking abuse protection
  387. int m_iLastBlockAreaIndex;
  388. int m_iLastBlockCapAttempt;
  389. // Achievements Data
  390. int m_iComboWeaponKillMask;
  391. bool m_bAbortFreezeCam;
  392. bool m_bPlayedFreezeCamSound;
  393. CDODPlayerStatProperty m_StatProperty;
  394. EHANDLE m_hLastDroppedWeapon;
  395. EHANDLE m_hLastDroppedAmmoBox;
  396. float m_flTimeAsClassAccumulator;
  397. public:
  398. // LifeID is a unique int assigned to a player each time they spawn
  399. int GetLifeID() { return m_iLifeID; }
  400. int m_iLifeID;
  401. // Stats variables
  402. //==================
  403. // stats related to each weapon ( shots taken and given )
  404. weaponstat_t m_WeaponStats[MAX_WEAPONS];
  405. // a list of players I have killed ( by userid )
  406. CUtlMap<int, playerstat_t, int> m_KilledPlayers;
  407. // a list of players that have killed me ( by userid )
  408. CUtlMap<int, playerstat_t, int> m_KilledByPlayers;
  409. // start time - used to calc total time played
  410. // time played per class
  411. float m_flTimePlayedPerClass_Allies[7]; //0-5, 6 is random
  412. float m_flTimePlayedPerClass_Axis[7]; //0-5, 6 is random
  413. float m_flLastClassChangeTime;
  414. // area cap stats
  415. int m_iNumAreaDefenses;
  416. int m_iNumAreaCaptures;
  417. int m_iNumBonusRoundKills;
  418. // Per-Round Stats
  419. //================
  420. virtual void ResetPerRoundStats( void )
  421. {
  422. m_iPerRoundCaptures = 0;
  423. m_iPerRoundDefenses = 0;
  424. m_iPerRoundBombsDetonated = 0;
  425. m_iPerRoundKills = 0;
  426. }
  427. int GetPerRoundCaps( void )
  428. {
  429. return m_iPerRoundCaptures;
  430. }
  431. int GetPerRoundDefenses( void )
  432. {
  433. return m_iPerRoundDefenses;
  434. }
  435. int GetPerRoundBombsDetonated( void )
  436. {
  437. return m_iPerRoundBombsDetonated;
  438. }
  439. int GetPerRoundKills( void )
  440. {
  441. return m_iPerRoundKills;
  442. }
  443. int m_iPerRoundCaptures; // how many caps this round
  444. int m_iPerRoundDefenses; // how many defenses this round
  445. int m_iPerRoundBombsDetonated;
  446. int m_iPerRoundKills;
  447. };
  448. inline CDODPlayer *ToDODPlayer( CBaseEntity *pEntity )
  449. {
  450. if ( !pEntity || !pEntity->IsPlayer() )
  451. return NULL;
  452. #ifdef _DEBUG
  453. Assert( dynamic_cast<CDODPlayer*>( pEntity ) != 0 );
  454. #endif
  455. return static_cast< CDODPlayer* >( pEntity );
  456. }
  457. inline DODPlayerState CDODPlayer::State_Get() const
  458. {
  459. return m_iPlayerState;
  460. }
  461. #endif //DOD_PLAYER_H