Browse Source

Reformat some files yet.

wantedhl
Night Owl 8 years ago
parent
commit
3b8bc0a417
  1. 26
      cl_dll/StudioModelRenderer.cpp
  2. 5
      dlls/extdll.h
  3. 1
      dlls/monsterevent.h
  4. 1
      dlls/monsters.h
  5. 1
      dlls/mp5.cpp
  6. 54
      dlls/plats.cpp
  7. 73
      dlls/prop.cpp
  8. 17
      dlls/weapons.cpp

26
cl_dll/StudioModelRenderer.cpp

@ -344,8 +344,10 @@ void CStudioModelRenderer::StudioSlerpBones( vec4_t q1[], float pos1[][3], vec4_ @@ -344,8 +344,10 @@ void CStudioModelRenderer::StudioSlerpBones( vec4_t q1[], float pos1[][3], vec4_
vec4_t q3;
float s1;
if (s < 0) s = 0;
else if (s > 1.0) s = 1.0;
if( s < 0 )
s = 0;
else if( s > 1.0 )
s = 1.0;
s1 = 1.0 - s;
@ -488,7 +490,6 @@ void CStudioModelRenderer::StudioSetUpTransform (int trivial_accept) @@ -488,7 +490,6 @@ void CStudioModelRenderer::StudioSetUpTransform (int trivial_accept)
// NOTE: Because multiplayer lag can be relatively large, we don't want to cap
// f at 1.5 anymore.
//if( f > -1.0 && f < 1.5 ) {}
//Con_DPrintf( "%.0f %.0f\n",m_pCurrentEntity->msg_angles[0][YAW], m_pCurrentEntity->msg_angles[1][YAW] );
for( i = 0; i < 3; i++ )
{
@ -546,12 +547,9 @@ void CStudioModelRenderer::StudioSetUpTransform (int trivial_accept) @@ -546,12 +547,9 @@ void CStudioModelRenderer::StudioSetUpTransform (int trivial_accept)
{
for( i = 0; i < 4; i++ )
{
(*m_paliastransform)[0][i] *= m_fSoftwareXScale *
(1.0 / (ZISCALE * 0x10000));
(*m_paliastransform)[1][i] *= m_fSoftwareYScale *
(1.0 / (ZISCALE * 0x10000));
(*m_paliastransform)[0][i] *= m_fSoftwareXScale * ( 1.0 / ( ZISCALE * 0x10000 ) );
(*m_paliastransform)[1][i] *= m_fSoftwareYScale * ( 1.0 / ( ZISCALE * 0x10000 ) );
(*m_paliastransform)[2][i] *= 1.0 / ( ZISCALE * 0x10000 );
}
}
}
@ -561,7 +559,6 @@ void CStudioModelRenderer::StudioSetUpTransform (int trivial_accept) @@ -561,7 +559,6 @@ void CStudioModelRenderer::StudioSetUpTransform (int trivial_accept)
(*m_protationmatrix)[2][3] = modelpos[2];
}
/*
====================
StudioEstimateInterpolant
@ -619,7 +616,6 @@ void CStudioModelRenderer::StudioCalcRotations ( float pos[][3], vec4_t *q, mstu @@ -619,7 +616,6 @@ void CStudioModelRenderer::StudioCalcRotations ( float pos[][3], vec4_t *q, mstu
// Con_DPrintf( "frame %d %d\n", frame1, frame2 );
dadt = StudioEstimateInterpolant();
s = ( f - frame );
@ -707,7 +703,6 @@ void CStudioModelRenderer::StudioFxTransform( cl_entity_t *ent, float transform[ @@ -707,7 +703,6 @@ void CStudioModelRenderer::StudioFxTransform( cl_entity_t *ent, float transform[
transform[2][1] *= scale;
}
break;
}
}
@ -730,7 +725,6 @@ float CStudioModelRenderer::StudioEstimateFrame( mstudioseqdesc_t *pseqdesc ) @@ -730,7 +725,6 @@ float CStudioModelRenderer::StudioEstimateFrame( mstudioseqdesc_t *pseqdesc )
else
{
dfdt = ( m_clTime - m_pCurrentEntity->curstate.animtime ) * m_pCurrentEntity->curstate.framerate * pseqdesc->fps;
}
}
else
@ -846,8 +840,7 @@ void CStudioModelRenderer::StudioSetupBones ( void ) @@ -846,8 +840,7 @@ void CStudioModelRenderer::StudioSetupBones ( void )
}
}
if (m_fDoInterp &&
m_pCurrentEntity->latched.sequencetime &&
if( m_fDoInterp && m_pCurrentEntity->latched.sequencetime &&
( m_pCurrentEntity->latched.sequencetime + 0.2 > m_clTime ) &&
( m_pCurrentEntity->latched.prevsequence < m_pStudioHeader->numseq ) )
{
@ -961,7 +954,6 @@ void CStudioModelRenderer::StudioSetupBones ( void ) @@ -961,7 +954,6 @@ void CStudioModelRenderer::StudioSetupBones ( void )
}
}
/*
====================
StudioSaveBones
@ -985,7 +977,6 @@ void CStudioModelRenderer::StudioSaveBones( void ) @@ -985,7 +977,6 @@ void CStudioModelRenderer::StudioSaveBones( void )
}
}
/*
====================
StudioMergeBones
@ -1025,7 +1016,6 @@ void CStudioModelRenderer::StudioMergeBones ( model_t *m_pSubModel ) @@ -1025,7 +1016,6 @@ void CStudioModelRenderer::StudioMergeBones ( model_t *m_pSubModel )
pbones = (mstudiobone_t *)( (byte *)m_pStudioHeader + m_pStudioHeader->boneindex );
for( i = 0; i < m_pStudioHeader->numbones; i++ )
{
for( j = 0; j < m_nCachedBones; j++ )
@ -1255,7 +1245,6 @@ void CStudioModelRenderer::StudioEstimateGait( entity_state_t *pplayer ) @@ -1255,7 +1245,6 @@ void CStudioModelRenderer::StudioEstimateGait( entity_state_t *pplayer )
if( m_pPlayerInfo->gaityaw < -180 )
m_pPlayerInfo->gaityaw = -180;
}
}
/*
@ -1700,4 +1689,3 @@ void CStudioModelRenderer::StudioRenderFinal(void) @@ -1700,4 +1689,3 @@ void CStudioModelRenderer::StudioRenderFinal(void)
StudioRenderFinal_Software();
}
}

5
dlls/extdll.h

@ -15,7 +15,6 @@ @@ -15,7 +15,6 @@
#ifndef EXTDLL_H
#define EXTDLL_H
//
// Global header file for extension DLLs
//
@ -57,14 +56,13 @@ typedef int BOOL; @@ -57,14 +56,13 @@ typedef int BOOL;
#define max(a,b) (((a) > (b)) ? (a) : (b))
#endif
// Misc C-runtime library headers
#include "stdio.h"
#include "stdlib.h"
#include "math.h"
// Header file containing definition of globalvars_t and entvars_t
typedef unsigned int func_t; //
typedef unsigned int func_t;
typedef unsigned int string_t; // from engine's pr_comp.h;
typedef float vec_t; // needed before including progdefs.h
@ -84,5 +82,4 @@ typedef float vec_t; // needed before including progdefs.h @@ -84,5 +82,4 @@ typedef float vec_t; // needed before including progdefs.h
// Shared header between the client DLL and the game DLLs
#include "cdll_dll.h"
#endif //EXTDLL_H

1
dlls/monsterevent.h

@ -31,5 +31,4 @@ typedef struct @@ -31,5 +31,4 @@ typedef struct
#define MONSTER_EVENT_BODYDROP_HEAVY 2002
#define MONSTER_EVENT_SWISHSOUND 2010
#endif //MONSTEREVENT_H

1
dlls/monsters.h

@ -171,5 +171,4 @@ public: @@ -171,5 +171,4 @@ public:
return baseClass::ScheduleFromName( pName );\
return pSchedule;\
}
#endif //MONSTERS_H

1
dlls/mp5.cpp

@ -259,7 +259,6 @@ void CMP5::WeaponIdle( void ) @@ -259,7 +259,6 @@ void CMP5::WeaponIdle( void )
case 0:
iAnim = MP5_LONGIDLE;
break;
default:
case 1:
iAnim = MP5_IDLE1;

54
dlls/plats.cpp

@ -205,7 +205,6 @@ void CBasePlatTrain::Precache( void ) @@ -205,7 +205,6 @@ void CBasePlatTrain::Precache( void )
PRECACHE_SOUND( "plats/talkstop1.wav" );
pev->noiseArrived = MAKE_STRING( "plats/talkstop1.wav" );
break;
default:
pev->noiseArrived = MAKE_STRING( "common/null.wav" );
break;
@ -601,7 +600,6 @@ void CFuncPlatRot :: RotMove( Vector &destAngle, float time ) @@ -601,7 +600,6 @@ void CFuncPlatRot :: RotMove( Vector &destAngle, float time )
//
//====================== TRAIN code ==================================================
//
class CFuncTrain : public CBasePlatTrain
{
public:
@ -614,7 +612,6 @@ public: @@ -614,7 +612,6 @@ public:
void Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value );
void KeyValue( KeyValueData *pkvd );
void EXPORT Wait( void );
void EXPORT Next( void );
virtual int Save( CSave &save );
@ -704,7 +701,6 @@ void CFuncTrain :: Wait( void ) @@ -704,7 +701,6 @@ void CFuncTrain :: Wait( void )
}
// ALERT( at_console, "%f\n", m_flWait );
if( m_flWait != 0 )
{
// -1 wait will wait forever!
@ -728,7 +724,6 @@ void CFuncTrain :: Next( void ) @@ -728,7 +724,6 @@ void CFuncTrain :: Next( void )
{
CBaseEntity *pTarg;
// now find our next target
pTarg = GetNextTarget();
@ -815,7 +810,6 @@ dmg default 2 @@ -815,7 +810,6 @@ dmg default 2
sounds
1) ratchet metal
*/
void CFuncTrain::Spawn( void )
{
Precache();
@ -944,7 +938,7 @@ void CFuncTrackTrain :: KeyValue( KeyValueData *pkvd ) @@ -944,7 +938,7 @@ void CFuncTrackTrain :: KeyValue( KeyValueData *pkvd )
}
else if( FStrEq( pkvd->szKeyName, "volume" ) )
{
m_flVolume = (float) (atoi(pkvd->szValue));
m_flVolume = (float)atoi( pkvd->szValue );
m_flVolume *= 0.1;
pkvd->fHandled = TRUE;
}
@ -1066,7 +1060,6 @@ void CFuncTrackTrain :: StopSound( void ) @@ -1066,7 +1060,6 @@ void CFuncTrackTrain :: StopSound( void )
PLAYBACK_EVENT_FULL( FEV_RELIABLE | FEV_UPDATE, edict(), m_usAdjustPitch, 0.0,
(float *)&g_vecZero, (float *)&g_vecZero, 0.0, 0.0, us_encode, 0, 1, 0 );
/*
STOP_SOUND( ENT( pev ), CHAN_STATIC, (char*)STRING( pev->noise ) );
*/
@ -1079,7 +1072,6 @@ void CFuncTrackTrain :: StopSound( void ) @@ -1079,7 +1072,6 @@ void CFuncTrackTrain :: StopSound( void )
// update pitch based on speed, start sound if not playing
// NOTE: when train goes through transition, m_soundPlaying should go to 0,
// which will cause the looped sound to restart.
void CFuncTrackTrain::UpdateSound( void )
{
float flpitch;
@ -1229,7 +1221,7 @@ void CFuncTrackTrain :: Next( void ) @@ -1229,7 +1221,7 @@ void CFuncTrackTrain :: Next( void )
else // end of path, stop
{
StopSound();
pev->velocity = (nextPos - pev->origin);
pev->velocity = nextPos - pev->origin;
pev->avelocity = g_vecZero;
float distance = pev->velocity.Length();
m_oldSpeed = pev->speed;
@ -1488,12 +1480,30 @@ void CFuncTrackTrain :: Precache( void ) @@ -1488,12 +1480,30 @@ void CFuncTrackTrain :: Precache( void )
// no sound
pev->noise = 0;
break;
case 1: PRECACHE_SOUND("plats/ttrain1.wav"); pev->noise = MAKE_STRING("plats/ttrain1.wav");break;
case 2: PRECACHE_SOUND("plats/ttrain2.wav"); pev->noise = MAKE_STRING("plats/ttrain2.wav");break;
case 3: PRECACHE_SOUND("plats/ttrain3.wav"); pev->noise = MAKE_STRING("plats/ttrain3.wav");break;
case 4: PRECACHE_SOUND("plats/ttrain4.wav"); pev->noise = MAKE_STRING("plats/ttrain4.wav");break;
case 5: PRECACHE_SOUND("plats/ttrain6.wav"); pev->noise = MAKE_STRING("plats/ttrain6.wav");break;
case 6: PRECACHE_SOUND("plats/ttrain7.wav"); pev->noise = MAKE_STRING("plats/ttrain7.wav");break;
case 1:
PRECACHE_SOUND( "plats/ttrain1.wav" );
pev->noise = MAKE_STRING("plats/ttrain1.wav" );
break;
case 2:
PRECACHE_SOUND( "plats/ttrain2.wav" );
pev->noise = MAKE_STRING( "plats/ttrain2.wav" );
break;
case 3:
PRECACHE_SOUND( "plats/ttrain3.wav" );
pev->noise = MAKE_STRING( "plats/ttrain3.wav" );
break;
case 4:
PRECACHE_SOUND( "plats/ttrain4.wav" );
pev->noise = MAKE_STRING( "plats/ttrain4.wav" );
break;
case 5:
PRECACHE_SOUND( "plats/ttrain6.wav" );
pev->noise = MAKE_STRING( "plats/ttrain6.wav" );
break;
case 6:
PRECACHE_SOUND( "plats/ttrain7.wav" );
pev->noise = MAKE_STRING( "plats/ttrain7.wav" );
break;
}
PRECACHE_SOUND( "plats/ttrain_brake1.wav" );
@ -1551,7 +1561,6 @@ void CFuncTrainControls :: Spawn( void ) @@ -1551,7 +1561,6 @@ void CFuncTrainControls :: Spawn( void )
// Track changer / Train elevator
//
// ----------------------------------------------------------------------------
#define SF_TRACK_ACTIVATETRAIN 0x00000001
#define SF_TRACK_RELINK 0x00000002
#define SF_TRACK_ROTMOVE 0x00000004
@ -1563,8 +1572,12 @@ void CFuncTrainControls :: Spawn( void ) @@ -1563,8 +1572,12 @@ void CFuncTrainControls :: Spawn( void )
// It must be larger in X-Y planar area than the train, since it must contain the
// train within these dimensions in order to operate when the train is near it.
//
typedef enum { TRAIN_SAFE, TRAIN_BLOCKING, TRAIN_FOLLOWING } TRAIN_CODE;
typedef enum
{
TRAIN_SAFE,
TRAIN_BLOCKING,
TRAIN_FOLLOWING
}TRAIN_CODE;
class CFuncTrackChange : public CFuncPlatRot
{
@ -1836,7 +1849,6 @@ void CFuncTrackChange :: GoUp( void ) @@ -1836,7 +1849,6 @@ void CFuncTrackChange :: GoUp( void )
// HitTop may get called during CFuncPlat::GoUp(), so set up for that
// before you call GoUp();
UpdateAutoTargets( TS_GOING_UP );
if( FBitSet( pev->spawnflags, SF_TRACK_DONT_MOVE ) )
{
@ -1901,7 +1913,6 @@ void CFuncTrackChange :: Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE @@ -1901,7 +1913,6 @@ void CFuncTrackChange :: Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE
// Otherwise, it's safe to move
// If at top, go down
// at bottom, go up
DisableUse();
if( m_toggle_state == TS_AT_TOP )
GoDown();
@ -2172,7 +2183,6 @@ void CGunTarget::Stop( void ) @@ -2172,7 +2183,6 @@ void CGunTarget::Stop( void )
pev->takedamage = DAMAGE_NO;
}
int CGunTarget::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType )
{
if( pev->health > 0 )

73
dlls/prop.cpp

@ -33,8 +33,26 @@ @@ -33,8 +33,26 @@
#define SF_PROP_RESPAWN 8 // enable autorespawn
#define SF_PROP_BREAKABLE 16 // enable break/explode
#define SF_PROP_FIXED 32 // don't move untill touch
typedef enum { expRandom, expDirected} Explosions;
typedef enum { matGlass = 0, matWood, matMetal, matFlesh, matCinderBlock, matCeilingTile, matComputer, matUnbreakableGlass, matRocks, matNone, matLastMaterial } Materials;
typedef enum
{
expRandom,
expDirected
}Explosions;
typedef enum
{
matGlass = 0,
matWood,
matMetal,
matFlesh,
matCinderBlock,
matCeilingTile,
matComputer,
matUnbreakableGlass,
matRocks,
matNone,
matLastMaterial
}Materials;
//extern "C" void AngleVectors( const vec3_t angles, vec3_t forward, vec3_t right, vec3_t up);
Vector UTIL_AngleVectorsF( const Vector &angles )
@ -108,7 +126,6 @@ public: @@ -108,7 +126,6 @@ public:
inline int ExplosionMagnitude( void ) { return pev->impulse; }
inline void ExplosionSetMagnitude( int magnitude ) { pev->impulse = magnitude; }
static void MaterialSoundPrecache( Materials precacheMaterial );
static void MaterialSoundRandom( edict_t *pEdict, Materials soundMaterial, float volume );
static const char **MaterialSoundList( Materials precacheMaterial, int &soundCount );
@ -203,7 +220,6 @@ const char **CProp::MaterialSoundList( Materials precacheMaterial, int &soundCou @@ -203,7 +220,6 @@ const char **CProp::MaterialSoundList( Materials precacheMaterial, int &soundCou
pSoundList = pSoundsGlass;
soundCount = ARRAYSIZE( pSoundsGlass );
break;
case matMetal:
pSoundList = pSoundsMetal;
soundCount = ARRAYSIZE( pSoundsMetal );
@ -410,9 +426,11 @@ void CProp::Die( void ) @@ -410,9 +426,11 @@ void CProp::Die( void )
case matGlass:
switch( RANDOM_LONG( 0, 1 ) )
{
case 0: EMIT_SOUND_DYN(ENT(pev), CHAN_VOICE, "debris/bustglass1.wav", fvol, ATTN_NORM, 0, pitch);
case 0:
EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "debris/bustglass1.wav", fvol, ATTN_NORM, 0, pitch );
break;
case 1: EMIT_SOUND_DYN(ENT(pev), CHAN_VOICE, "debris/bustglass2.wav", fvol, ATTN_NORM, 0, pitch);
case 1:
EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "debris/bustglass2.wav", fvol, ATTN_NORM, 0, pitch );
break;
}
cFlag = BREAK_GLASS;
@ -420,9 +438,11 @@ void CProp::Die( void ) @@ -420,9 +438,11 @@ void CProp::Die( void )
case matWood:
switch( RANDOM_LONG( 0, 1 ) )
{
case 0: EMIT_SOUND_DYN(ENT(pev), CHAN_VOICE, "debris/bustcrate1.wav", fvol, ATTN_NORM, 0, pitch);
case 0:
EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "debris/bustcrate1.wav", fvol, ATTN_NORM, 0, pitch );
break;
case 1: EMIT_SOUND_DYN(ENT(pev), CHAN_VOICE, "debris/bustcrate2.wav", fvol, ATTN_NORM, 0, pitch);
case 1:
EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "debris/bustcrate2.wav", fvol, ATTN_NORM, 0, pitch );
break;
}
cFlag = BREAK_WOOD;
@ -431,9 +451,11 @@ void CProp::Die( void ) @@ -431,9 +451,11 @@ void CProp::Die( void )
case matMetal:
switch( RANDOM_LONG( 0, 1 ) )
{
case 0: EMIT_SOUND_DYN(ENT(pev), CHAN_VOICE, "debris/bustmetal1.wav", fvol, ATTN_NORM, 0, pitch);
case 0:
EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "debris/bustmetal1.wav", fvol, ATTN_NORM, 0, pitch );
break;
case 1: EMIT_SOUND_DYN(ENT(pev), CHAN_VOICE, "debris/bustmetal2.wav", fvol, ATTN_NORM, 0, pitch);
case 1:
EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "debris/bustmetal2.wav", fvol, ATTN_NORM, 0, pitch );
break;
}
cFlag = BREAK_METAL;
@ -441,9 +463,11 @@ void CProp::Die( void ) @@ -441,9 +463,11 @@ void CProp::Die( void )
case matFlesh:
switch( RANDOM_LONG( 0, 1 ) )
{
case 0: EMIT_SOUND_DYN(ENT(pev), CHAN_VOICE, "debris/bustflesh1.wav", fvol, ATTN_NORM, 0, pitch);
case 0:
EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "debris/bustflesh1.wav", fvol, ATTN_NORM, 0, pitch );
break;
case 1: EMIT_SOUND_DYN(ENT(pev), CHAN_VOICE, "debris/bustflesh2.wav", fvol, ATTN_NORM, 0, pitch);
case 1:
EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "debris/bustflesh2.wav", fvol, ATTN_NORM, 0, pitch );
break;
}
cFlag = BREAK_FLESH;
@ -452,9 +476,11 @@ void CProp::Die( void ) @@ -452,9 +476,11 @@ void CProp::Die( void )
case matCinderBlock:
switch( RANDOM_LONG( 0, 1 ) )
{
case 0: EMIT_SOUND_DYN(ENT(pev), CHAN_VOICE, "debris/bustconcrete1.wav", fvol, ATTN_NORM, 0, pitch);
case 0:
EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "debris/bustconcrete1.wav", fvol, ATTN_NORM, 0, pitch );
break;
case 1: EMIT_SOUND_DYN(ENT(pev), CHAN_VOICE, "debris/bustconcrete2.wav", fvol, ATTN_NORM, 0, pitch);
case 1:
EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "debris/bustconcrete2.wav", fvol, ATTN_NORM, 0, pitch );
break;
}
cFlag = BREAK_CONCRETE;
@ -667,15 +693,13 @@ void CProp::CheckRotate() @@ -667,15 +693,13 @@ void CProp::CheckRotate()
UTIL_SetSize(pev, minsH, maxsH);
return;
}
if( (fabs(UTIL_AngleDiff(pev->angles.z, 90)) < 20) ||
(fabs(sin(pev->angles.x / 180 * M_PI)) > 0.3) )
if( ( fabs( UTIL_AngleDiff( pev->angles.z, 90 ) ) < 20 ) || ( fabs( sin( pev->angles.x / 180 * M_PI ) ) > 0.3 ) )
m_shape = SHAPE_CYL_H;
else
m_shape = SHAPE_CYL_V;
if( m_oldshape != m_shape )
{
if( m_shape == SHAPE_CYL_H )
{
pev->angles.y += 90;
@ -848,9 +872,15 @@ void CProp::BounceSound(void) @@ -848,9 +872,15 @@ void CProp::BounceSound(void)
{
switch( RANDOM_LONG( 0, 2 ) )
{
case 0: EMIT_SOUND(ENT(pev), CHAN_VOICE, "weapons/grenade_hit1.wav", 0.25, ATTN_NORM); break;
case 1: EMIT_SOUND(ENT(pev), CHAN_VOICE, "weapons/grenade_hit2.wav", 0.25, ATTN_NORM); break;
case 2: EMIT_SOUND(ENT(pev), CHAN_VOICE, "weapons/grenade_hit3.wav", 0.25, ATTN_NORM); break;
case 0:
EMIT_SOUND( ENT( pev ), CHAN_VOICE, "weapons/grenade_hit1.wav", 0.25, ATTN_NORM );
break;
case 1:
EMIT_SOUND( ENT( pev ), CHAN_VOICE, "weapons/grenade_hit2.wav", 0.25, ATTN_NORM );
break;
case 2:
EMIT_SOUND( ENT( pev ), CHAN_VOICE, "weapons/grenade_hit3.wav", 0.25, ATTN_NORM );
break;
}
}
@ -1027,8 +1057,7 @@ void CProp::DieThink() @@ -1027,8 +1057,7 @@ void CProp::DieThink()
int CProp::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType )
{
Vector r = ( pevInflictor->origin - pev->origin );
if ( (!m_attacker
|| (pev->velocity.Length() < 700))
if( ( !m_attacker || ( pev->velocity.Length() < 700 ) )
&& ( (CBaseEntity*)GET_PRIVATE( ENT( pevAttacker ) ) )->IsPlayer() )
m_attacker = ENT( pevAttacker );
DeployThink();

17
dlls/weapons.cpp

@ -99,7 +99,6 @@ void ClearMultiDamage(void) @@ -99,7 +99,6 @@ void ClearMultiDamage(void)
//
// GLOBALS USED:
// gMultiDamage
void ApplyMultiDamage( entvars_t *pevInflictor, entvars_t *pevAttacker )
{
Vector vecSpot1;//where blood comes from
@ -114,7 +113,6 @@ void ApplyMultiDamage(entvars_t *pevInflictor, entvars_t *pevAttacker ) @@ -114,7 +113,6 @@ void ApplyMultiDamage(entvars_t *pevInflictor, entvars_t *pevAttacker )
// GLOBALS USED:
// gMultiDamage
void AddMultiDamage( entvars_t *pevInflictor, CBaseEntity *pEntity, float flDamage, int bitsDamageType )
{
if( !pEntity )
@ -193,7 +191,6 @@ void DecalGunshot( TraceResult *pTrace, int iBulletType ) @@ -193,7 +191,6 @@ void DecalGunshot( TraceResult *pTrace, int iBulletType )
void EjectBrass( const Vector &vecOrigin, const Vector &vecVelocity, float rotation, int model, int soundtype )
{
// FIX: when the player shoots, their gun isn't in the same position as it is on the model other players see.
MESSAGE_BEGIN( MSG_PVS, SVC_TEMPENTITY, vecOrigin );
WRITE_BYTE( TE_MODEL );
WRITE_COORD( vecOrigin.x );
@ -326,9 +323,7 @@ void W_Precache(void) @@ -326,9 +323,7 @@ void W_Precache(void)
// python
UTIL_PrecacheOtherWeapon( "weapon_357" );
UTIL_PrecacheOther( "ammo_357" );
#endif
#if !defined( OEM_BUILD ) && !defined( HLDEMO_BUILD )
// gauss
UTIL_PrecacheOtherWeapon( "weapon_gauss" );
UTIL_PrecacheOther( "ammo_gaussclip" );
@ -336,9 +331,7 @@ void W_Precache(void) @@ -336,9 +331,7 @@ void W_Precache(void)
// rpg
UTIL_PrecacheOtherWeapon( "weapon_rpg" );
UTIL_PrecacheOther( "ammo_rpgclip" );
#endif
#if !defined( OEM_BUILD ) && !defined( HLDEMO_BUILD )
// crossbow
UTIL_PrecacheOtherWeapon( "weapon_crossbow" );
UTIL_PrecacheOther( "ammo_crossbow" );
@ -651,7 +644,6 @@ void CBasePlayerWeapon::ItemPostFrame( void ) @@ -651,7 +644,6 @@ void CBasePlayerWeapon::ItemPostFrame( void )
else if( !( m_pPlayer->pev->button & ( IN_ATTACK | IN_ATTACK2 ) ) )
{
// no fire buttons down
m_fFireOnEmpty = FALSE;
if( !IsUseable() && m_flNextPrimaryAttack < ( UseDecrement() ? 0.0 : gpGlobals->time ) )
@ -786,8 +778,7 @@ int CBasePlayerWeapon::UpdateClientData( CBasePlayer *pPlayer ) @@ -786,8 +778,7 @@ int CBasePlayerWeapon::UpdateClientData( CBasePlayer *pPlayer )
}
// This is the current or last weapon, so the state will need to be updated
if ( this == pPlayer->m_pActiveItem ||
this == pPlayer->m_pClientActiveItem )
if( this == pPlayer->m_pActiveItem || this == pPlayer->m_pClientActiveItem )
{
if( pPlayer->m_pActiveItem != pPlayer->m_pClientActiveItem )
{
@ -796,9 +787,7 @@ int CBasePlayerWeapon::UpdateClientData( CBasePlayer *pPlayer ) @@ -796,9 +787,7 @@ int CBasePlayerWeapon::UpdateClientData( CBasePlayer *pPlayer )
}
// If the ammo, state, or fov has changed, update the weapon
if ( m_iClip != m_iClientClip ||
state != m_iClientWeaponState ||
pPlayer->m_iFOV != pPlayer->m_iClientFOV )
if( m_iClip != m_iClientClip || state != m_iClientWeaponState || pPlayer->m_iFOV != pPlayer->m_iClientFOV )
{
bSend = TRUE;
}
@ -1468,7 +1457,6 @@ void CWeaponBox::SetObjectCollisionBox( void ) @@ -1468,7 +1457,6 @@ void CWeaponBox::SetObjectCollisionBox( void )
pev->absmax = pev->origin + Vector( 16, 16, 16 );
}
void CBasePlayerWeapon::PrintState( void )
{
ALERT( at_console, "primary: %f\n", m_flNextPrimaryAttack );
@ -1542,4 +1530,3 @@ TYPEDESCRIPTION CSatchel::m_SaveData[] = @@ -1542,4 +1530,3 @@ TYPEDESCRIPTION CSatchel::m_SaveData[] =
};
IMPLEMENT_SAVERESTORE( CSatchel, CBasePlayerWeapon )

Loading…
Cancel
Save