Browse Source

Cleanup.

dmc
Night Owl 8 years ago
parent
commit
e58740d9be
  1. 2
      dlls/cbase.cpp
  2. 18
      dlls/cbase.h
  3. 32
      dlls/client.cpp
  4. 8
      dlls/combat.cpp
  5. 2
      dlls/multiplay_gamerules.cpp
  6. 59
      dlls/player.cpp
  7. 9
      dlls/player.h

2
dlls/cbase.cpp

@ -511,7 +511,7 @@ int CBaseEntity::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, fl @@ -511,7 +511,7 @@ int CBaseEntity::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, fl
// (that is, no actual entity projectile was involved in the attack so use the shooter's origin).
if( pevAttacker == pevInflictor )
{
vecTemp = pevInflictor->origin - VecBModelOrigin( pev );
vecTemp = pevAttacker->origin - VecBModelOrigin( pev );
}
else
// an actual missile was involved.

18
dlls/cbase.h

@ -339,24 +339,6 @@ public: @@ -339,24 +339,6 @@ public:
BOOL m_bAxHitMe;
void Spawn_Telefog( Vector vecOrg, CBaseEntity *pOther );
Vector m_vecTeleAngles;
//We use this variables to store each ammo count.
int ammo_9mm;
int ammo_357;
int ammo_bolts;
int ammo_buckshot;
int ammo_rockets;
int ammo_uranium;
int ammo_hornets;
int ammo_argrens;
//Special stuff for grenades and satchels.
float m_flStartThrow;
float m_flReleaseThrow;
int m_chargeReady;
int m_fInAttack;
enum EGON_FIRESTATE { FIRE_OFF, FIRE_CHARGE };
int m_fireState;
};
// Ugly technique to override base member functions

32
dlls/client.cpp

@ -1739,15 +1739,6 @@ int GetWeaponData( struct edict_s *player, struct weapon_data_s *info ) @@ -1739,15 +1739,6 @@ int GetWeaponData( struct edict_s *player, struct weapon_data_s *info )
item->m_flNextPrimaryAttack = max( gun->m_flNextPrimaryAttack, -0.001 );
item->m_flNextSecondaryAttack = max( gun->m_flNextSecondaryAttack, -0.001 );
item->m_fInReload = gun->m_fInReload;
item->m_fInSpecialReload = gun->m_fInSpecialReload;
item->fuser1 = max( gun->pev->fuser1, -0.001 );
item->fuser2 = gun->m_flStartThrow;
item->fuser3 = gun->m_flReleaseThrow;
item->iuser1 = gun->m_chargeReady;
item->iuser2 = gun->m_fInAttack;
item->iuser3 = gun->m_fireState;
//item->m_flPumpTime = max( gun->m_flPumpTime, -0.001 );
}
}
pPlayerItem = pPlayerItem->m_pNext;
@ -1813,16 +1804,6 @@ void UpdateClientData( const struct edict_s *ent, int sendweapons, struct client @@ -1813,16 +1804,6 @@ void UpdateClientData( const struct edict_s *ent, int sendweapons, struct client
if( pl )
{
cd->m_flNextAttack = pl->m_flNextAttack;
cd->fuser2 = pl->m_flNextAmmoBurn;
cd->fuser3 = pl->m_flAmmoStartCharge;
cd->vuser1.x = pl->ammo_9mm;
cd->vuser1.y = pl->ammo_357;
cd->vuser1.z = pl->ammo_argrens;
cd->ammo_nails = pl->ammo_bolts;
cd->ammo_shells = pl->ammo_buckshot;
cd->ammo_rockets = pl->ammo_rockets;
cd->ammo_cells = pl->ammo_uranium;
cd->vuser2.x = pl->ammo_hornets;
cd->weapons = pl->m_iQuakeItems;
if( pl->m_pActiveItem )
@ -1835,11 +1816,6 @@ void UpdateClientData( const struct edict_s *ent, int sendweapons, struct client @@ -1835,11 +1816,6 @@ void UpdateClientData( const struct edict_s *ent, int sendweapons, struct client
gun->GetItemInfo( &II );
cd->m_iId = II.iId;
cd->vuser3.z = gun->m_iSecondaryAmmoType;
cd->vuser4.x = gun->m_iPrimaryAmmoType;
cd->vuser4.y = pl->m_rgAmmo[gun->m_iPrimaryAmmoType];
cd->vuser4.z = pl->m_rgAmmo[gun->m_iSecondaryAmmoType];
}
}
cd->fuser1 = (float)pl->m_iQuakeWeapon;
@ -1944,13 +1920,13 @@ int GetHullBounds( int hullnumber, float *mins, float *maxs ) @@ -1944,13 +1920,13 @@ int GetHullBounds( int hullnumber, float *mins, float *maxs )
switch( hullnumber )
{
case 0: // Normal player
mins = VEC_HULL_MIN;
maxs = VEC_HULL_MAX;
mins = Vector( -16, -16, -32 );
maxs = Vector( 16, 16, 32 );
iret = 1;
break;
case 1: // Crouched player
mins = VEC_DUCK_HULL_MIN;
maxs = VEC_DUCK_HULL_MAX;
mins = Vector( -16, -16, -32 );
maxs = Vector( 16, 16, 32 );
iret = 1;
break;
case 2: // Point based hull

8
dlls/combat.cpp

@ -24,7 +24,6 @@ @@ -24,7 +24,6 @@
#include "util.h"
#include "cbase.h"
#include "monsters.h"
#include "soundent.h"
#include "decals.h"
#include "animation.h"
#include "weapons.h"
@ -548,13 +547,6 @@ void CGib::WaitTillLand( void ) @@ -548,13 +547,6 @@ void CGib::WaitTillLand( void )
{
SetThink( &CBaseEntity::SUB_StartFadeOut );
pev->nextthink = gpGlobals->time + m_lifeTime;
// If you bleed, you stink!
if( m_bloodColor != DONT_BLEED )
{
// ok, start stinkin!
CSoundEnt::InsertSound( bits_SOUND_MEAT, pev->origin, 384, 25 );
}
}
else
{

2
dlls/multiplay_gamerules.cpp

@ -228,7 +228,7 @@ void CHalfLifeMultiplay::Think( void ) @@ -228,7 +228,7 @@ void CHalfLifeMultiplay::Think( void )
int time = (int)CVAR_GET_FLOAT( "mp_chattime" );
if( time < 1 )
CVAR_SET_STRING( "mp_chattime", "1" );
else if( time > MAX_INTERMISSION_TIME )
else if( time > INTERMISSION_TIME )
CVAR_SET_STRING( "mp_chattime", UTIL_dtos1( INTERMISSION_TIME ) );
m_flIntermissionEndTime = g_flIntermissionStartTime + mp_chattime.value;

59
dlls/player.cpp

@ -789,25 +789,6 @@ void CBasePlayer::SetAnimation( PLAYER_ANIM playerAnim ) @@ -789,25 +789,6 @@ void CBasePlayer::SetAnimation( PLAYER_ANIM playerAnim )
ResetSequenceInfo();
}
/*
===========
TabulateAmmo
This function is used to find and store
all the ammo we have into the ammo vars.
============
*/
void CBasePlayer::TabulateAmmo()
{
ammo_9mm = AmmoInventory( GetAmmoIndex( "9mm" ) );
ammo_357 = AmmoInventory( GetAmmoIndex( "357" ) );
ammo_argrens = AmmoInventory( GetAmmoIndex( "ARgrenades" ) );
ammo_bolts = AmmoInventory( GetAmmoIndex( "bolts" ) );
ammo_buckshot = AmmoInventory( GetAmmoIndex( "buckshot" ) );
ammo_rockets = AmmoInventory( GetAmmoIndex( "rockets" ) );
ammo_uranium = AmmoInventory( GetAmmoIndex( "uranium" ) );
ammo_hornets = AmmoInventory( GetAmmoIndex( "Hornets" ) );
}
/*
===========
WaterMove
@ -2269,17 +2250,6 @@ pt_end: @@ -2269,17 +2250,6 @@ pt_end:
{
gun->m_flTimeWeaponIdle = max( gun->m_flTimeWeaponIdle - gpGlobals->frametime, -0.001 );
}
if( gun->pev->fuser1 != 1000 )
{
gun->pev->fuser1 = max( gun->pev->fuser1 - gpGlobals->frametime, -0.001 );
}
// Only decrement if not flagged as NO_DECREMENT
/*if( gun->m_flPumpTime != 1000 )
{
gun->m_flPumpTime = max( gun->m_flPumpTime - gpGlobals->frametime, -0.001 );
}*/
}
pPlayerItem = pPlayerItem->m_pNext;
@ -2290,22 +2260,6 @@ pt_end: @@ -2290,22 +2260,6 @@ pt_end:
m_flNextAttack -= gpGlobals->frametime;
if( m_flNextAttack < -0.001 )
m_flNextAttack = -0.001;
if( m_flNextAmmoBurn != 1000 )
{
m_flNextAmmoBurn -= gpGlobals->frametime;
if( m_flNextAmmoBurn < -0.001 )
m_flNextAmmoBurn = -0.001;
}
if( m_flAmmoStartCharge != 1000 )
{
m_flAmmoStartCharge -= gpGlobals->frametime;
if( m_flAmmoStartCharge < -0.001 )
m_flAmmoStartCharge = -0.001;
}
#else
return;
#endif
@ -2653,17 +2607,6 @@ int CBasePlayer::Restore( CRestore &restore ) @@ -2653,17 +2607,6 @@ int CBasePlayer::Restore( CRestore &restore )
UTIL_SetSize( pev, VEC_HULL_MIN, VEC_HULL_MAX );
}*/
g_engfuncs.pfnSetPhysicsKeyValue( edict(), "hl", "1" );
if( m_fLongJump )
{
g_engfuncs.pfnSetPhysicsKeyValue( edict(), "slj", "1" );
}
else
{
g_engfuncs.pfnSetPhysicsKeyValue( edict(), "slj", "0" );
}
RenewItems();
#if defined( CLIENT_WEAPONS )
@ -3399,8 +3342,6 @@ int CBasePlayer::GiveAmmo( int iCount, char *szName, int iMax ) @@ -3399,8 +3342,6 @@ int CBasePlayer::GiveAmmo( int iCount, char *szName, int iMax )
MESSAGE_END();
}
TabulateAmmo();
return i;
}

9
dlls/player.h

@ -15,7 +15,7 @@ @@ -15,7 +15,7 @@
#ifndef PLAYER_H
#define PLAYER_H
#include "pm_materials.h"
//#include "pm_materials.h"
#define PLAYER_FATAL_FALL_SPEED 1024// approx 60 feet
#define PLAYER_MAX_SAFE_FALL_SPEED 580// approx 20 feet
@ -294,13 +294,6 @@ public: @@ -294,13 +294,6 @@ public:
void SetCustomDecalFrames( int nFrames );
int GetCustomDecalFrames( void );
void TabulateAmmo( void );
float m_flStartCharge;
float m_flAmmoStartCharge;
float m_flPlayAftershock;
float m_flNextAmmoBurn;// while charging, when to absorb another unit of player's ammo?
//Player ID
void InitStatusBar( void );
void UpdateStatusBar( void );

Loading…
Cancel
Save