From 6e6d5397275621714c3381915b112dcce2c8eeab Mon Sep 17 00:00:00 2001 From: mittorn Date: Wed, 17 Aug 2016 12:20:18 +0000 Subject: [PATCH] Fix build after merge --- dlls/items.h | 1 + dlls/monsters.h | 1 + dlls/multiplay_gamerules.cpp | 1 - dlls/prop.cpp | 478 ++++++++++++++++++----------------- dlls/weapons.cpp | 2 +- 5 files changed, 243 insertions(+), 240 deletions(-) diff --git a/dlls/items.h b/dlls/items.h index b9b7e56c..68ef4da9 100644 --- a/dlls/items.h +++ b/dlls/items.h @@ -27,5 +27,6 @@ public: return FALSE; }; virtual float TouchGravGun( CBaseEntity *attacker, int stage); + Vector m_SpawnPoint; }; #endif // ITEMS_H diff --git a/dlls/monsters.h b/dlls/monsters.h index 0c6af445..9b701c12 100644 --- a/dlls/monsters.h +++ b/dlls/monsters.h @@ -156,6 +156,7 @@ public: return 700; } + float m_flNextAttack; int m_bloodColor; int m_cBloodDecals; int m_material; diff --git a/dlls/multiplay_gamerules.cpp b/dlls/multiplay_gamerules.cpp index 649289d2..1835d4ab 100644 --- a/dlls/multiplay_gamerules.cpp +++ b/dlls/multiplay_gamerules.cpp @@ -48,7 +48,6 @@ float g_flIntermissionStartTime = 0; #ifndef NO_VOICEGAMEMGR CVoiceGameMgr g_VoiceGameMgr; -#endif class CMultiplayGameMgrHelper : public IVoiceGameMgrHelper { diff --git a/dlls/prop.cpp b/dlls/prop.cpp index 7faeda07..b850f9f6 100644 --- a/dlls/prop.cpp +++ b/dlls/prop.cpp @@ -31,13 +31,10 @@ #include "gamerules.h" #define SF_PROP_RESPAWN 8 // enable autorespawn -#define SF_PROP_BREAKABLE 16 // enable break/explode +#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 { expRandom, expDirected} Explosions; +typedef enum { matGlass = 0, matWood, matMetal, matFlesh, matCinderBlock, matCeilingTile, matComputer, matUnbreakableGlass, matRocks, matNone, matLastMaterial } Materials; // round() has problems, so just implement it here static inline int myround(float f) @@ -50,25 +47,25 @@ Vector UTIL_AngleVectorsF(const Vector &angles) { float rgflVecOut[3]; float rgflVecIn[3]; - angles.CopyToArray( rgflVecIn ); - g_engfuncs.pfnAngleVectors( rgflVecIn, rgflVecOut, NULL, NULL ); - return Vector( rgflVecOut ); + angles.CopyToArray(rgflVecIn); + g_engfuncs.pfnAngleVectors(rgflVecIn, rgflVecOut, NULL, NULL); + return Vector(rgflVecOut); } -Vector UTIL_AngleVectorsR( const Vector &angles ) +Vector UTIL_AngleVectorsR(const Vector &angles) { float rgflVecOut[3]; float rgflVecIn[3]; - angles.CopyToArray( rgflVecIn ); - g_engfuncs.pfnAngleVectors( rgflVecIn, NULL, rgflVecOut, NULL ); - return Vector( rgflVecOut ); + angles.CopyToArray(rgflVecIn); + g_engfuncs.pfnAngleVectors(rgflVecIn, NULL, rgflVecOut, NULL); + return Vector(rgflVecOut); } -Vector UTIL_AngleVectorsU( const Vector &angles ) +Vector UTIL_AngleVectorsU(const Vector &angles) { float rgflVecOut[3]; float rgflVecIn[3]; - angles.CopyToArray( rgflVecIn ); - g_engfuncs.pfnAngleVectors( rgflVecIn, NULL, rgflVecOut, NULL ); - return Vector( rgflVecOut ); + angles.CopyToArray(rgflVecIn); + g_engfuncs.pfnAngleVectors(rgflVecIn, NULL, rgflVecOut, NULL); + return Vector(rgflVecOut); } //===================grenade @@ -85,7 +82,7 @@ enum PropShape class CProp : public CBaseEntity { public: - void Spawn( void ); + void Spawn(void); void Precache(); void EXPORT BounceTouch(CBaseEntity *pOther); @@ -151,7 +148,7 @@ public: void EXPORT DieThink(); void DamageSound( void ); void PropRespawn(); - void KeyValue( KeyValueData *pkvd ); + void KeyValue( KeyValueData* pkvd); static const char *pSoundsWood[]; static const char *pSoundsFlesh[]; @@ -160,14 +157,15 @@ public: static const char *pSoundsConcrete[]; static const char *pSpawnObjects[]; - inline BOOL Explodable( void ) { return ExplosionMagnitude() > 0; } - inline int ExplosionMagnitude( void ) { return pev->impulse; } - inline void ExplosionSetMagnitude( int magnitude ) { pev->impulse = magnitude; } + inline BOOL Explodable( void ) { return ExplosionMagnitude() > 0; } + 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 ); - void EXPORT Die( void ); + void EXPORT Die( void ); BOOL m_bBarrel; float m_flFloorFriction; @@ -189,16 +187,15 @@ public: PropShape m_oldshape; EHANDLE m_pHolstered; float m_flSpawnHealth; - int m_idShard; - float m_angle; - int m_iszGibModel; - Materials m_Material; - Explosions m_Explosion; + int m_idShard; + float m_angle; + int m_iszGibModel; + Materials m_Material; + Explosions m_Explosion; int m_iaCustomAnglesX[10]; int m_iaCustomAnglesZ[10]; }; - -LINK_ENTITY_TO_CLASS( prop, CProp ) +LINK_ENTITY_TO_CLASS(prop, CProp); const char *CProp::pSoundsWood[] = { @@ -231,6 +228,7 @@ const char *CProp::pSoundsConcrete[] = "debris/concrete3.wav", }; + const char *CProp::pSoundsGlass[] = { "debris/glass1.wav", @@ -240,33 +238,37 @@ const char *CProp::pSoundsGlass[] = const char **CProp::MaterialSoundList( Materials precacheMaterial, int &soundCount ) { - const char **pSoundList = NULL; + const char **pSoundList = NULL; - switch( precacheMaterial ) + switch ( precacheMaterial ) { case matWood: pSoundList = pSoundsWood; - soundCount = ARRAYSIZE( pSoundsWood ); + soundCount = ARRAYSIZE(pSoundsWood); break; case matFlesh: pSoundList = pSoundsFlesh; - soundCount = ARRAYSIZE( pSoundsFlesh ); + soundCount = ARRAYSIZE(pSoundsFlesh); break; case matComputer: case matUnbreakableGlass: case matGlass: pSoundList = pSoundsGlass; - soundCount = ARRAYSIZE( pSoundsGlass ); + soundCount = ARRAYSIZE(pSoundsGlass); break; + case matMetal: pSoundList = pSoundsMetal; - soundCount = ARRAYSIZE( pSoundsMetal ); + soundCount = ARRAYSIZE(pSoundsMetal); break; + case matCinderBlock: case matRocks: pSoundList = pSoundsConcrete; - soundCount = ARRAYSIZE( pSoundsConcrete ); + soundCount = ARRAYSIZE(pSoundsConcrete); break; + + case matCeilingTile: case matNone: default: @@ -279,12 +281,12 @@ const char **CProp::MaterialSoundList( Materials precacheMaterial, int &soundCou void CProp::MaterialSoundPrecache( Materials precacheMaterial ) { - const char **pSoundList; - int i, soundCount = 0; + const char **pSoundList; + int i, soundCount = 0; pSoundList = MaterialSoundList( precacheMaterial, soundCount ); - for( i = 0; i < soundCount; i++ ) + for ( i = 0; i < soundCount; i++ ) { PRECACHE_SOUND( (char *)pSoundList[i] ); } @@ -292,13 +294,13 @@ void CProp::MaterialSoundPrecache( Materials precacheMaterial ) void CProp::MaterialSoundRandom( edict_t *pEdict, Materials soundMaterial, float volume ) { - const char **pSoundList; - int soundCount = 0; + const char **pSoundList; + int soundCount = 0; pSoundList = MaterialSoundList( soundMaterial, soundCount ); - if( soundCount ) - EMIT_SOUND( pEdict, CHAN_BODY, pSoundList[RANDOM_LONG( 0, soundCount - 1 )], volume, 1.0 ); + if ( soundCount ) + EMIT_SOUND( pEdict, CHAN_BODY, pSoundList[ RANDOM_LONG(0,soundCount-1) ], volume, 1.0 ); } void CProp::Precache( void ) @@ -308,57 +310,58 @@ void CProp::Precache( void ) if( !pev->model ) pev->model = MAKE_STRING( "models/xash/barrel_brown.mdl" ); - switch( m_Material ) + switch (m_Material) { case matWood: pGibName = "models/woodgibs.mdl"; - PRECACHE_SOUND( "debris/bustcrate1.wav" ); - PRECACHE_SOUND( "debris/bustcrate2.wav" ); + PRECACHE_SOUND("debris/bustcrate1.wav"); + PRECACHE_SOUND("debris/bustcrate2.wav"); break; case matFlesh: pGibName = "models/fleshgibs.mdl"; - PRECACHE_SOUND( "debris/bustflesh1.wav" ); - PRECACHE_SOUND( "debris/bustflesh2.wav" ); + PRECACHE_SOUND("debris/bustflesh1.wav"); + PRECACHE_SOUND("debris/bustflesh2.wav"); break; case matComputer: - PRECACHE_SOUND( "buttons/spark5.wav"); - PRECACHE_SOUND( "buttons/spark6.wav"); + PRECACHE_SOUND("buttons/spark5.wav"); + PRECACHE_SOUND("buttons/spark6.wav"); pGibName = "models/computergibs.mdl"; - PRECACHE_SOUND( "debris/bustmetal1.wav" ); - PRECACHE_SOUND( "debris/bustmetal2.wav" ); + PRECACHE_SOUND("debris/bustmetal1.wav"); + PRECACHE_SOUND("debris/bustmetal2.wav"); break; + case matUnbreakableGlass: case matGlass: pGibName = "models/glassgibs.mdl"; - PRECACHE_SOUND( "debris/bustglass1.wav" ); - PRECACHE_SOUND( "debris/bustglass2.wav" ); + PRECACHE_SOUND("debris/bustglass1.wav"); + PRECACHE_SOUND("debris/bustglass2.wav"); break; case matMetal: pGibName = "models/metalplategibs.mdl"; - PRECACHE_SOUND( "debris/bustmetal1.wav" ); - PRECACHE_SOUND( "debris/bustmetal2.wav" ); + PRECACHE_SOUND("debris/bustmetal1.wav"); + PRECACHE_SOUND("debris/bustmetal2.wav"); break; case matCinderBlock: pGibName = "models/cindergibs.mdl"; - PRECACHE_SOUND( "debris/bustconcrete1.wav" ); - PRECACHE_SOUND( "debris/bustconcrete2.wav" ); + PRECACHE_SOUND("debris/bustconcrete1.wav"); + PRECACHE_SOUND("debris/bustconcrete2.wav"); break; case matRocks: pGibName = "models/rockgibs.mdl"; - PRECACHE_SOUND( "debris/bustconcrete1.wav" ); - PRECACHE_SOUND( "debris/bustconcrete2.wav" ); + PRECACHE_SOUND("debris/bustconcrete1.wav"); + PRECACHE_SOUND("debris/bustconcrete2.wav"); break; case matCeilingTile: pGibName = "models/ceilinggibs.mdl"; - PRECACHE_SOUND( "debris/bustceiling.wav" ); + PRECACHE_SOUND ("debris/bustceiling.wav"); break; } MaterialSoundPrecache( m_Material ); @@ -377,20 +380,20 @@ void CProp::DamageSound( void ) int i = 0; int material = m_Material; - //if( RANDOM_LONG( 0, 1 ) ) - // return; +// if (RANDOM_LONG(0,1)) +// return; - if( RANDOM_LONG( 0, 2 ) ) + if (RANDOM_LONG(0,2)) pitch = PITCH_NORM; else - pitch = 95 + RANDOM_LONG( 0, 34 ); + pitch = 95 + RANDOM_LONG(0,34); - fvol = RANDOM_FLOAT( 0.75, 1.0 ); + fvol = RANDOM_FLOAT(0.75, 1.0); - if( material == matComputer && RANDOM_LONG( 0, 1 ) ) + if (material == matComputer && RANDOM_LONG(0,1)) material = matMetal; - switch( material ) + switch (material) { case matComputer: case matGlass: @@ -400,18 +403,21 @@ void CProp::DamageSound( void ) rgpsz[2] = "debris/glass3.wav"; i = 3; break; + case matWood: rgpsz[0] = "debris/wood1.wav"; rgpsz[1] = "debris/wood2.wav"; rgpsz[2] = "debris/wood3.wav"; i = 3; break; + case matMetal: rgpsz[0] = "debris/metal1.wav"; rgpsz[1] = "debris/metal3.wav"; rgpsz[2] = "debris/metal2.wav"; i = 2; break; + case matFlesh: rgpsz[0] = "debris/flesh1.wav"; rgpsz[1] = "debris/flesh2.wav"; @@ -421,6 +427,7 @@ void CProp::DamageSound( void ) rgpsz[5] = "debris/flesh7.wav"; i = 6; break; + case matRocks: case matCinderBlock: rgpsz[0] = "debris/concrete1.wav"; @@ -428,14 +435,15 @@ void CProp::DamageSound( void ) rgpsz[2] = "debris/concrete3.wav"; i = 3; break; + case matCeilingTile: // UNDONE: no ceiling tile shard sound yet i = 0; break; } - if( i ) - EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, rgpsz[RANDOM_LONG( 0, i - 1 )], fvol, ATTN_NORM, 0, pitch ); + if (i) + EMIT_SOUND_DYN(ENT(pev), CHAN_VOICE, rgpsz[RANDOM_LONG(0,i-1)], fvol, ATTN_NORM, 0, pitch); } void CProp::Die( void ) @@ -446,89 +454,86 @@ void CProp::Die( void ) int pitch; float fvol; - pitch = 95 + RANDOM_LONG( 0, 29 ); + pitch = 95 + RANDOM_LONG(0,29); - if( pitch > 97 && pitch < 103 ) + if (pitch > 97 && pitch < 103) pitch = 100; // The more negative pev->health, the louder // the sound should be. - fvol = RANDOM_FLOAT( 0.85, 1.0 ) + ( fabs( pev->health ) / 100.0 ); + fvol = RANDOM_FLOAT(0.85, 1.0) + (fabs(pev->health) / 100.0); - if( fvol > 1.0 ) + if (fvol > 1.0) fvol = 1.0; - switch( m_Material ) + + switch (m_Material) { case matGlass: - switch( RANDOM_LONG( 0, 1 ) ) + 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; break; + case matWood: - switch( RANDOM_LONG( 0, 1 ) ) + 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; break; + case matComputer: case matMetal: - switch( RANDOM_LONG( 0, 1 ) ) + 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; break; + case matFlesh: - switch( RANDOM_LONG( 0, 1 ) ) + 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; break; + case matRocks: case matCinderBlock: - switch( RANDOM_LONG( 0, 1 ) ) + 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; break; + case matCeilingTile: - EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "debris/bustceiling.wav", fvol, ATTN_NORM, 0, pitch ); + EMIT_SOUND_DYN(ENT(pev), CHAN_VOICE, "debris/bustceiling.wav", fvol, ATTN_NORM, 0, pitch); break; } - if( m_Explosion == expDirected ) + + if (m_Explosion == expDirected) vecVelocity = g_vecAttackDir * 200; else { @@ -573,9 +578,9 @@ void CProp::Die( void ) MESSAGE_END(); float size = pev->size.x; - if( size < pev->size.y ) + if ( size < pev->size.y ) size = pev->size.y; - if( size < pev->size.z ) + if ( size < pev->size.z ) size = pev->size.z; // !!! HACK This should work! @@ -588,9 +593,9 @@ void CProp::Die( void ) // BUGBUG -- can only find 256 entities on a breakable -- should be enough CBaseEntity *pList[256]; int count = UTIL_EntitiesInBox( pList, 256, mins, maxs, FL_ONGROUND ); - if( count ) + if ( count ) { - for( int i = 0; i < count; i++ ) + for ( int i = 0; i < count; i++ ) { ClearBits( pList[i]->pev->flags, FL_ONGROUND ); pList[i]->pev->groundentity = NULL; @@ -601,7 +606,6 @@ void CProp::Die( void ) pev->targetname = 0; pev->solid = SOLID_NOT; - // Fire targets on break SUB_UseTargets( NULL, USE_TOGGLE, 0 ); @@ -610,10 +614,10 @@ void CProp::Die( void ) ExplosionCreate( pev->origin, pev->angles, m_attacker->edict(), ExplosionMagnitude(), FALSE ); RadiusDamage ( pev->origin, pev, m_attacker->pev, ExplosionMagnitude(), ExplosionMagnitude() * 2.5 , CLASS_NONE, DMG_BLAST ); } - UTIL_SetSize( pev, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ) ); + UTIL_SetSize(pev, Vector( 0, 0, 0), Vector(0, 0, 0) ); } -void CProp::Killed( entvars_t *pevAttacker, int iGib ) +void CProp::Killed(entvars_t *pevAttacker, int iGib) { pev->takedamage = DAMAGE_NO; pev->deadflag = DEAD_DEAD; @@ -627,14 +631,14 @@ void CProp::Killed( entvars_t *pevAttacker, int iGib ) //m_attacker = NULL; } -void CProp::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value ) +void CProp::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) { - if( pev->health <= 0 ) + if( pev->health <= 0) return; pev->movetype = MOVETYPE_BOUNCE; if (m_owner2 != pActivator) { - if( pev->velocity.Length() < 100 && pActivator->IsPlayer() ) + if (pev->velocity.Length() < 100 && pActivator->IsPlayer()) { m_owner2 = m_attacker = pActivator; } @@ -669,7 +673,6 @@ void CProp::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType pev->nextthink = gpGlobals->time + 0.2; } } - Vector target = pActivator->pev->origin + UTIL_GetAimVector(m_owner2->edict(), 1000) * 50; target.z = target.z + 32; pev->velocity = (target - VecBModelOrigin(pev)) * 10; @@ -691,17 +694,17 @@ void CProp::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType pev->avelocity.x = pev->avelocity.x*1.5 + RANDOM_FLOAT(100, -100); //pev->avelocity.z = pev->avelocity.z*0.5 + RANDOM_FLOAT ( 100, -100 ); } - if ( ( pActivator->pev->button & ( IN_ATTACK2 ) ) ) + if ((pActivator->pev->button & (IN_ATTACK2))) { //m_Horizontal = false; //pev->angles.z = 0; } - // m_Horizontal = ( fabs( UTIL_AngleDiff( pev->angles.z, 90 ) ) < 20 ) || ( sin( pev->angles.x / 180 * M_PI ) > 0.1 ); + // m_Horizontal = (fabs(UTIL_AngleDiff(pev->angles.z, 90)) < 20) || ( sin(pev->angles.x/180*M_PI) > 0.1); // CheckRotate(); - //ALERT( at_console, "Prop use!\n" ); + //ALERT( at_console, "Prop use!\n"); } -void CProp::Force( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value ) +void CProp::Force(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) { if( pev->health <= 0 ) return; @@ -713,21 +716,21 @@ void CProp::Force( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useTy return; } - if( ( pActivator->pev->button & ( IN_ATTACK ) ) ) + if ((pActivator->pev->button & (IN_ATTACK))) { pev->velocity = UTIL_GetAimVector(m_owner2->edict(), 3000) * 1000; pev->avelocity.y = pev->avelocity.y*1.5 + RANDOM_FLOAT(100, -100); pev->avelocity.x = pev->avelocity.x*1.5 + RANDOM_FLOAT(100, -100); //pev->avelocity.z = pev->avelocity.z*0.5 + RANDOM_FLOAT ( 100, -100 ); } - if( ( pActivator->pev->button & ( IN_ATTACK2 ) ) ) + if ((pActivator->pev->button & (IN_ATTACK2))) { //m_Horizontal = false; //pev->angles.z = 0; } pev->nextthink = gpGlobals->time + m_flRespawnTime; - SetThink( &CProp::RespawnThink ); + SetThink( &CProp::RespawnThink); } void CProp::CheckRotate() @@ -737,45 +740,47 @@ 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_oldshape != m_shape) { - if( m_shape == SHAPE_CYL_H ) + + if (m_shape == SHAPE_CYL_H) { pev->angles.y += 90; - ALERT( at_console, "setH: %f %f %f\n", pev->angles.x, pev->angles.y, pev->angles.z ); + ALERT(at_console, "setH: %f %f %f\n", pev->angles.x, pev->angles.y, pev->angles.z); - UTIL_SetSize( pev, minsH, maxsH ); + UTIL_SetSize(pev, minsH, maxsH); } - else if( m_shape == SHAPE_CYL_V ) + else if (m_shape == SHAPE_CYL_V) { Vector mins = pev->absmin; Vector maxs = pev->absmax; mins.z = pev->absmax.z; maxs.z += 10; - ALERT( at_console, "setV: %f %f %f\n", pev->angles.x, pev->angles.y, pev->angles.z ); + ALERT(at_console, "setV: %f %f %f\n", pev->angles.x, pev->angles.y, pev->angles.z); // BUGBUG -- can only find 256 entities on a prop -- should be enough CBaseEntity *pList[256]; int count = UTIL_EntitiesInBox( pList, 256, mins, maxs, FL_ONGROUND ); - if( count ) + if ( count ) { - for( int i = 0; i < count; i++ ) + for ( int i = 0; i < count; i++ ) { pList[i]->pev->origin.z += 10; } } pev->origin.z += 10; //pev->angles.y -= 90; - UTIL_SetSize( pev, minsV, maxsV ); + UTIL_SetSize(pev, minsV, maxsV); } - //DROP_TO_FLOOR( edict() ); + //DROP_TO_FLOOR(edict()); //pev->origin.z += 0.5; m_oldshape = m_shape; } @@ -806,7 +811,7 @@ void CProp::DeployThink( void ) } } -void CProp::BounceTouch( CBaseEntity *pOther ) +void CProp::BounceTouch(CBaseEntity *pOther) { if( pev->health <= 0 ) { @@ -818,7 +823,7 @@ void CProp::BounceTouch( CBaseEntity *pOther ) // only do damage if we're moving fairly fast DeployThink(); - if( m_flNextAttack < gpGlobals->time && pev->velocity.Length() > 300 ) + if ( m_flNextAttack < gpGlobals->time && pev->velocity.Length() > 300) { if( !m_attacker ) m_attacker = this; @@ -829,19 +834,18 @@ void CProp::BounceTouch( CBaseEntity *pOther ) if (pOther == m_owner2) { dmg = 5; - if( pOther->pev->button & ( IN_USE ) ) + if (pOther->pev->button & (IN_USE)) { dmg = 1; } } TraceResult tr = UTIL_GetGlobalTrace(); ClearMultiDamage(); - pOther->TraceAttack( pevOwner, dmg, gpGlobals->v_forward, &tr, DMG_CLUB ); - ApplyMultiDamage( pev, pevOwner ); + pOther->TraceAttack(pevOwner, dmg, gpGlobals->v_forward, &tr, DMG_CLUB); + ApplyMultiDamage(pev, pevOwner); } m_flNextAttack = gpGlobals->time + 1.0; // debounce } - if( (pOther != m_owner2) && (pev->spawnflags & SF_PROP_BREAKABLE) && (pev->velocity.Length() > 1800) ) { pev->nextthink = gpGlobals->time + 0.1; @@ -849,22 +853,23 @@ void CProp::BounceTouch( CBaseEntity *pOther ) } pev->velocity = pev->velocity + pOther->pev->velocity; - float dp = cos( M_PI / 180 * UTIL_AngleDiff( UTIL_VecToAngles( pev->velocity ).y, pev->angles.y ) ); - if( pev->flags & FL_ONGROUND || fabs( pev->velocity.z ) < 40 ) + float dp = cos(M_PI / 180 * UTIL_AngleDiff(UTIL_VecToAngles(pev->velocity).y, pev->angles.y)); + if (pev->flags & FL_ONGROUND || fabs(pev->velocity.z) < 40) { CheckRotate(); - if( m_shape == SHAPE_CYL_H ) + if (m_shape == SHAPE_CYL_H) { - pev->velocity.x *= fabs( dp ) * 0.8 + 0.2; - pev->velocity.y *= fabs( dp ) * 0.8 + 0.2; + + pev->velocity.x *= fabs(dp) * 0.8 + 0.2; + pev->velocity.y *= fabs(dp) * 0.8 + 0.2; pev->velocity.z -= 20; pev->avelocity.x = -dp*pev->velocity.Length()* 1.5; pev->avelocity.y = 0; pev->avelocity.z = 0; - pev->angles.z += UTIL_AngleDiff( 90, pev->angles.z ) * 0.7; + pev->angles.z += UTIL_AngleDiff(90, pev->angles.z) * 0.7; //AngleThink(); } - else if( m_shape == SHAPE_CYL_V ) + else if (m_shape == SHAPE_CYL_V) { // pev->angles.z *= 0.3; //pev->angles.x *= 0.3; @@ -874,13 +879,13 @@ void CProp::BounceTouch( CBaseEntity *pOther ) pev->velocity.x *= m_flFloorFriction; pev->velocity.y *= m_flFloorFriction; pev->velocity.z -= 10; - pev->avelocity.y = pev->avelocity.y * 0.4 + RANDOM_FLOAT( 30, -30 ); + pev->avelocity.y = pev->avelocity.y*0.4 + RANDOM_FLOAT(30, -30); } else if( m_shape == SHAPE_SPHERE ) { pev->velocity.z -= 20; - pev->avelocity.x = -cos( M_PI / 180 * UTIL_AngleDiff( UTIL_VecToAngles( pev->velocity ).y, pev->angles.y ) ) * pev->velocity.Length() * 1.5; - pev->avelocity.y = -sin( M_PI / 180 * UTIL_AngleDiff( UTIL_VecToAngles( pev->velocity ).y, pev->angles.y ) ) * pev->velocity.Length() * 1.5;; + pev->avelocity.x = -cos(M_PI / 180 * UTIL_AngleDiff(UTIL_VecToAngles(pev->velocity).y, pev->angles.y))*pev->velocity.Length()* 1.5; + pev->avelocity.y = -sin(M_PI / 180 * UTIL_AngleDiff(UTIL_VecToAngles(pev->velocity).y, pev->angles.y))*pev->velocity.Length()* 1.5;; pev->avelocity.z = 0; } else if( m_shape == SHAPE_BOX || m_shape == SHAPE_GENERIC ) @@ -890,6 +895,7 @@ void CProp::BounceTouch( CBaseEntity *pOther ) pev->velocity.y *= m_flFloorFriction; pev->velocity.z -= 10; } + } else { @@ -899,54 +905,49 @@ void CProp::BounceTouch( CBaseEntity *pOther ) pev->velocity.x *= m_flCollideFriction; if( m_shape != SHAPE_SPHERE ) { - pev->avelocity.y = pev->avelocity.y * 0.4 + RANDOM_FLOAT( 100, -100 ); - pev->avelocity.x = pev->avelocity.x * 0.5 + RANDOM_FLOAT( 100, -100 ); + pev->avelocity.y = pev->avelocity.y*0.4 + RANDOM_FLOAT(100, -100); + pev->avelocity.x = pev->avelocity.x*0.5 + RANDOM_FLOAT(100, -100); } } - //pev->avelocity.z = pev->avelocity.z*0.5 + RANDOM_FLOAT( 1, -1 ); + //pev->avelocity.z = pev->avelocity.z*0.5 + RANDOM_FLOAT ( 1, -1 ); BounceSound(); } pev->framerate = pev->velocity.Length() / 200.0; - if( pev->framerate > 1.0 ) + if (pev->framerate > 1.0) pev->framerate = 1; - else if( pev->framerate < 0.2 ) + else if (pev->framerate < 0.2) { CheckRotate(); AngleThink(); - if( pev->angles.z == 0 || pev->angles.z == 90 ) + if (pev->angles.z == 0 || pev->angles.z == 90) pev->framerate = 0; else pev->framerate = 0.2; } } -void CProp::BounceSound( void ) +void CProp::BounceSound(void) { - switch( RANDOM_LONG( 0, 2 ) ) + 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; } } -void CProp::Spawn( void ) +void CProp::Spawn(void) { + Precache(); if( minsH == g_vecZero ) { // default barrel parameters - minsV = Vector( -10, -10, -17 ); - maxsV = Vector( 10, 10, 18 ); - minsH = Vector( -10, -10, -10 ); - maxsH = Vector( 10, 10, 13 ); + minsV = Vector(-10, -10, -17); + maxsV = Vector(10, 10, 18); + minsH = Vector(-10, -10, -10); + maxsH = Vector(10, 10, 13); } m_flCollideFriction = 0.7; m_flFloorFriction = 0.5; @@ -973,7 +974,7 @@ void CProp::Spawn( void ) void CProp::PropRespawn() { - UTIL_SetSize( pev, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ) ); + UTIL_SetSize(pev, Vector( 0, 0, 0), Vector(0, 0, 0) ); pev->effects &= ~EF_NODRAW; if( pev->spawnflags & SF_PROP_FIXED ) pev->movetype = MOVETYPE_NONE; @@ -985,8 +986,8 @@ void CProp::PropRespawn() pev->velocity = pev->avelocity = g_vecZero; pev->angles = spawnAngles; pev->deadflag = DEAD_NO; - SET_MODEL( ENT( pev ), STRING( pev->model ) ); - m_oldshape = ( PropShape ) - 1; + SET_MODEL( ENT(pev), STRING(pev->model) ); + m_oldshape = (PropShape)-1; CheckRotate(); SetTouch( &CProp::BounceTouch ); SetUse( &CProp::Use ); @@ -999,7 +1000,7 @@ void CProp::PropRespawn() void CProp::RespawnThink() { - if( !( pev->spawnflags & SF_PROP_RESPAWN ) ) + if( !(pev->spawnflags & SF_PROP_RESPAWN)) { if( pev->health <= 0 ) { @@ -1011,38 +1012,40 @@ void CProp::RespawnThink() PropRespawn(); } + + void CProp::AngleThink() { pev->nextthink = gpGlobals->time + m_flRespawnTime; SetThink( &CProp::RespawnThink); - if(! ( pev->flags & FL_ONGROUND || fabs( pev->velocity.z ) < 40 ) ) + if (!(pev->flags & FL_ONGROUND || fabs(pev->velocity.z) < 40)) { m_owner2 = m_attacker = 0; return; } - if( m_shape == SHAPE_CYL_H ) + if (m_shape == SHAPE_CYL_H) { - pev->angles.z += UTIL_AngleDiff( 90, pev->angles.z ) * 0.7; - if( fabs( UTIL_AngleDiff( 90, pev->angles.z ) ) > 0.1 ) + pev->angles.z += UTIL_AngleDiff(90, pev->angles.z) * 0.7; + if (fabs(UTIL_AngleDiff(90, pev->angles.z)) > 0.1) { - SetThink( &CProp::AngleThink ); + SetThink( &CProp::AngleThink); pev->nextthink = gpGlobals->time + 0.1; } //ALERT( at_console, "AngleThink: %f %f %f\n", pev->angles.x, pev->angles.y, pev->angles.z ); pev->avelocity.y = pev->avelocity.z = 0; } - else if( m_shape == SHAPE_CYL_V ) + else if (m_shape == SHAPE_CYL_V) { - if( fabs( UTIL_AngleDiff( 90, pev->angles.z ) ) > 0.1 ) + if (fabs(UTIL_AngleDiff(90, pev->angles.z)) > 0.1) { - SetThink( &CProp::AngleThink ); + SetThink( &CProp::AngleThink); pev->nextthink = gpGlobals->time + 0.1; } - pev->angles.z += UTIL_AngleDiff( 0, pev->angles.z ) * 0.7; + pev->angles.z += UTIL_AngleDiff(0, pev->angles.z) * 0.7; //pev->angles.x += UTIL_AngleDiff( 0, pev->angles.x ) * 0.3; pev->avelocity.x = pev->avelocity.y = pev->avelocity.z = 0; } - else if( m_shape == SHAPE_BOX ) + else if (m_shape == SHAPE_BOX) { Vector iangles; iangles.x = myround( pev->angles.x / 90 ) * 90; @@ -1052,40 +1055,39 @@ void CProp::AngleThink() //fabs(UTIL_AngleDiff(iangles.y, pev->angles.y)) > 0.1 || fabs(UTIL_AngleDiff(iangles.z, pev->angles.z)) > 0.1) { - SetThink( &CProp::AngleThink ); + SetThink( &CProp::AngleThink); pev->nextthink = gpGlobals->time + 0.1; } - pev->angles.x += UTIL_AngleDiff( iangles.x, pev->angles.x ) * 0.6; - //pev->angles.y += UTIL_AngleDiff( iangles.y, pev->angles.y ) * 0.6; - pev->angles.z += UTIL_AngleDiff( iangles.z, pev->angles.z ) * 0.6; + pev->angles.x += UTIL_AngleDiff(iangles.x, pev->angles.x) * 0.6; + //pev->angles.y += UTIL_AngleDiff(iangles.y, pev->angles.y) * 0.6; + pev->angles.z += UTIL_AngleDiff(iangles.z, pev->angles.z) * 0.6; pev->avelocity.x = pev->avelocity.y = pev->avelocity.z = 0; } - else if( m_shape == SHAPE_NOROTATE ) + else if (m_shape == SHAPE_NOROTATE) { pev->avelocity.x = pev->avelocity.y = pev->avelocity.z = 0; Vector iangles = spawnAngles; - if( fabs(UTIL_AngleDiff( iangles.x, pev->angles.x ) ) > 0.1 || - fabs( UTIL_AngleDiff( iangles.y, pev->angles.y ) ) > 0.1 || - fabs( UTIL_AngleDiff( iangles.z, pev->angles.z ) ) > 0.1 ) + if (fabs(UTIL_AngleDiff(iangles.x, pev->angles.x)) > 0.1 || + fabs(UTIL_AngleDiff(iangles.y, pev->angles.y)) > 0.1 || + fabs(UTIL_AngleDiff(iangles.z, pev->angles.z)) > 0.1) { - SetThink( &CProp::AngleThink ); + SetThink( &CProp::AngleThink); pev->nextthink = gpGlobals->time + 0.1; } - pev->angles.x += UTIL_AngleDiff( iangles.x, pev->angles.x ) * 0.6; - pev->angles.y += UTIL_AngleDiff( iangles.y, pev->angles.y ) * 0.6; - pev->angles.z += UTIL_AngleDiff( iangles.z, pev->angles.z ) * 0.6; + pev->angles.x += UTIL_AngleDiff(iangles.x, pev->angles.x) * 0.6; + pev->angles.y += UTIL_AngleDiff(iangles.y, pev->angles.y) * 0.6; + pev->angles.z += UTIL_AngleDiff(iangles.z, pev->angles.z) * 0.6; } - else if( m_shape == SHAPE_GENERIC ) + else if (m_shape == SHAPE_GENERIC) { float ianglex = 0, ianglez = 0, imaxanglediff=360.0f; int i; // if first number is zero, it is angle // all other zeroes is array end - for( i = 0; (i < 10) && ( (i == 0 ) || m_iaCustomAnglesX[i] ); i++) { - float anglediff = fabs( UTIL_AngleDiff( pev->angles.x, m_iaCustomAnglesX[i] ) ); + float anglediff = fabs(UTIL_AngleDiff(pev->angles.x, m_iaCustomAnglesX[i])); if( imaxanglediff > anglediff ) { ianglex = m_iaCustomAnglesX[i]; @@ -1093,38 +1095,37 @@ void CProp::AngleThink() } } imaxanglediff=360.0f; - for( i = 0; (i < 10) && ( (i == 0 ) || m_iaCustomAnglesZ[i] ); i++) { - float anglediff = fabs( UTIL_AngleDiff( pev->angles.z, m_iaCustomAnglesZ[i] ) ); + float anglediff = fabs(UTIL_AngleDiff(pev->angles.z, m_iaCustomAnglesZ[i])); if( imaxanglediff > anglediff ) { ianglez = m_iaCustomAnglesZ[i]; imaxanglediff = anglediff; } } - if( fabs( UTIL_AngleDiff( ianglex, pev->angles.x ) ) > 0.1 || - fabs( UTIL_AngleDiff( ianglez, pev->angles.z ) ) > 0.1 ) + if (fabs(UTIL_AngleDiff(ianglex, pev->angles.x)) > 0.1 || + fabs(UTIL_AngleDiff(ianglez, pev->angles.z)) > 0.1 ) { - SetThink( &CProp::AngleThink ); + SetThink( &CProp::AngleThink); pev->nextthink = gpGlobals->time + 0.1; } - pev->angles.x += UTIL_AngleDiff( ianglex, pev->angles.x ) * 0.6; - pev->angles.z += UTIL_AngleDiff( ianglez, pev->angles.z ) * 0.6; + pev->angles.x += UTIL_AngleDiff(ianglex, pev->angles.x) * 0.6; + pev->angles.z += UTIL_AngleDiff(ianglez, pev->angles.z) * 0.6; pev->avelocity.x = pev->avelocity.y = pev->avelocity.z = 0; } - pev->angles.x = UTIL_AngleMod( pev->angles.x ); - pev->angles.y = UTIL_AngleMod( pev->angles.y ); - pev->angles.z = UTIL_AngleMod( pev->angles.z ); + pev->angles.x = UTIL_AngleMod(pev->angles.x); + pev->angles.y = UTIL_AngleMod(pev->angles.y); + pev->angles.z = UTIL_AngleMod(pev->angles.z); } void CProp::DieThink() { - Killed( VARS( m_attacker ), GIB_NORMAL ); + Killed( VARS(m_attacker), GIB_NORMAL ); Die(); } -int CProp::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType ) +int CProp::TakeDamage(entvars_t* pevInflictor, entvars_t* pevAttacker, float flDamage, int bitsDamageType) { Vector r = (pevInflictor->origin - pev->origin); if ( (!m_attacker @@ -1134,26 +1135,27 @@ int CProp::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, float fl DeployThink(); pev->velocity = r * flDamage / -7; - pev->avelocity.x = pev->avelocity.x*0.5 + RANDOM_FLOAT( 100, -100 ); - ALERT( at_console, "Takedmg: %s %s %f %f\n", STRING( pevInflictor->classname ), STRING( pevAttacker->classname ), flDamage, pev->health ); + pev->avelocity.x = pev->avelocity.x*0.5 + RANDOM_FLOAT(100, -100); + ALERT(at_console, "Takedmg: %s %s %f %f\n", STRING(pevInflictor->classname), STRING(pevAttacker->classname), flDamage, pev->health ); // now some func_breakable code - if( !( pev->spawnflags & SF_PROP_BREAKABLE ) ) + + if ( !(pev->spawnflags & SF_PROP_BREAKABLE ) ) return 0; if ( pev->health <= 0 ) return 0; // Breakables take double damage from the crowbar - if( bitsDamageType & DMG_CLUB ) + if ( bitsDamageType & DMG_CLUB ) flDamage *= 2; // Boxes / glass / etc. don't take much poison damage, just the impact of the dart - consider that 10% - if( bitsDamageType & DMG_POISON ) + if ( bitsDamageType & DMG_POISON ) flDamage *= 0.1; g_vecAttackDir = r.Normalize(); // do the damage pev->health -= flDamage; - if( pev->health <= 0 ) + if ( pev->health <= 0 ) { // delayed explode SetThink( &CProp::DieThink ); @@ -1163,90 +1165,90 @@ int CProp::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, float fl // Make a shard noise each time func breakable is hit. // Don't play shard noise if cbreakable actually died. + DamageSound(); return 1; } - void CProp::KeyValue( KeyValueData* pkvd ) { - ALERT( at_console, "%s %s\n", pkvd->szKeyName, pkvd->szValue ); + ALERT( at_console, "%s %s\n", pkvd->szKeyName, pkvd->szValue); // UNDONE_WC: explicitly ignoring these fields, but they shouldn't be in the map file! - if( FStrEq( pkvd->szKeyName, "explosion" ) ) + if (FStrEq(pkvd->szKeyName, "explosion")) { - if( !stricmp( pkvd->szValue, "directed" ) ) + if (!stricmp(pkvd->szValue, "directed")) m_Explosion = expDirected; - else if( !stricmp(pkvd->szValue, "random" ) ) + else if (!stricmp(pkvd->szValue, "random")) m_Explosion = expRandom; else m_Explosion = expRandom; pkvd->fHandled = TRUE; } - else if( FStrEq( pkvd->szKeyName, "material" ) ) + else if (FStrEq(pkvd->szKeyName, "material")) { - int i = atoi( pkvd->szValue ); + int i = atoi( pkvd->szValue); // 0:glass, 1:metal, 2:flesh, 3:wood - if( ( i < 0 ) || ( i >= matLastMaterial ) ) + if ((i < 0) || (i >= matLastMaterial)) m_Material = matWood; else m_Material = (Materials)i; pkvd->fHandled = TRUE; } - else if( FStrEq( pkvd->szKeyName, "shape" ) ) + else if (FStrEq(pkvd->szKeyName, "shape")) { - int i = atoi( pkvd->szValue ); + int i = atoi( pkvd->szValue); - if( ( i < 0 ) || ( i >= SHAPE_NOROTATE ) ) + if ((i < 0) || (i >= SHAPE_NOROTATE)) m_shape = SHAPE_NOROTATE; else m_shape = (PropShape)i; pkvd->fHandled = TRUE; } - else if( FStrEq( pkvd->szKeyName, "gibmodel" ) ) + else if (FStrEq(pkvd->szKeyName, "gibmodel") ) { - m_iszGibModel = ALLOC_STRING( pkvd->szValue ); + m_iszGibModel = ALLOC_STRING(pkvd->szValue); pkvd->fHandled = TRUE; } - else if( FStrEq( pkvd->szKeyName, "explodemagnitude" ) ) + else if (FStrEq(pkvd->szKeyName, "explodemagnitude") ) { ExplosionSetMagnitude( atoi( pkvd->szValue ) ); pkvd->fHandled = TRUE; } - else if( FStrEq( pkvd->szKeyName, "respawntime" ) ) + else if (FStrEq(pkvd->szKeyName, "respawntime") ) { m_flRespawnTime = atof( pkvd->szValue ); pkvd->fHandled = TRUE; } - else if( FStrEq( pkvd->szKeyName, "customanglesx" ) ) + else if (FStrEq(pkvd->szKeyName, "customanglesx")) { UTIL_StringToIntArray( m_iaCustomAnglesX, ARRAYSIZE( m_iaCustomAnglesX ), pkvd->szValue ); pkvd->fHandled = TRUE; } - else if( FStrEq( pkvd->szKeyName, "customanglesz" ) ) + else if (FStrEq(pkvd->szKeyName, "customanglesz")) { UTIL_StringToIntArray( m_iaCustomAnglesZ, ARRAYSIZE( m_iaCustomAnglesZ ), pkvd->szValue ); pkvd->fHandled = TRUE; } - else if( FStrEq( pkvd->szKeyName, "hmin" ) ) + else if (FStrEq(pkvd->szKeyName, "hmin")) { UTIL_StringToVector( minsH, pkvd->szValue ); pkvd->fHandled = TRUE; } - else if( FStrEq( pkvd->szKeyName, "hmax" ) ) + else if (FStrEq(pkvd->szKeyName, "hmax")) { UTIL_StringToVector( maxsH, pkvd->szValue ); pkvd->fHandled = TRUE; } - else if( FStrEq( pkvd->szKeyName, "vmin" ) ) + else if (FStrEq(pkvd->szKeyName, "vmin")) { UTIL_StringToVector( minsV, pkvd->szValue ); pkvd->fHandled = TRUE; } - else if( FStrEq( pkvd->szKeyName, "vmax" ) ) + else if (FStrEq(pkvd->szKeyName, "vmax")) { UTIL_StringToVector( maxsV, pkvd->szValue ); pkvd->fHandled = TRUE; diff --git a/dlls/weapons.cpp b/dlls/weapons.cpp index cecd564c..95ef87ac 100644 --- a/dlls/weapons.cpp +++ b/dlls/weapons.cpp @@ -350,7 +350,7 @@ void W_Precache( void ) // hornetgun UTIL_PrecacheOtherWeapon( "weapon_hornetgun" ); - +#endif UTIL_PrecacheOtherWeapon( "weapon_gravgun" ); UTIL_PrecacheOtherWeapon( "weapon_ar2" );