Fix build after merge

This commit is contained in:
mittorn 2016-08-17 12:20:18 +00:00
parent 899cc814fb
commit 6e6d539727
5 changed files with 243 additions and 240 deletions

View File

@ -27,5 +27,6 @@ public:
return FALSE; return FALSE;
}; };
virtual float TouchGravGun( CBaseEntity *attacker, int stage); virtual float TouchGravGun( CBaseEntity *attacker, int stage);
Vector m_SpawnPoint;
}; };
#endif // ITEMS_H #endif // ITEMS_H

View File

@ -156,6 +156,7 @@ public:
return 700; return 700;
} }
float m_flNextAttack;
int m_bloodColor; int m_bloodColor;
int m_cBloodDecals; int m_cBloodDecals;
int m_material; int m_material;

View File

@ -48,7 +48,6 @@ float g_flIntermissionStartTime = 0;
#ifndef NO_VOICEGAMEMGR #ifndef NO_VOICEGAMEMGR
CVoiceGameMgr g_VoiceGameMgr; CVoiceGameMgr g_VoiceGameMgr;
#endif
class CMultiplayGameMgrHelper : public IVoiceGameMgrHelper class CMultiplayGameMgrHelper : public IVoiceGameMgrHelper
{ {

View File

@ -33,11 +33,8 @@
#define SF_PROP_RESPAWN 8 // enable autorespawn #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 #define SF_PROP_FIXED 32 // don't move untill touch
typedef enum typedef enum { expRandom, expDirected} Explosions;
{ typedef enum { matGlass = 0, matWood, matMetal, matFlesh, matCinderBlock, matCeilingTile, matComputer, matUnbreakableGlass, matRocks, matNone, matLastMaterial } Materials;
expRandom,
expDirected
}Explosions;
// round() has problems, so just implement it here // round() has problems, so just implement it here
static inline int myround(float f) static inline int myround(float f)
@ -164,6 +161,7 @@ public:
inline int ExplosionMagnitude( void ) { return pev->impulse; } inline int ExplosionMagnitude( void ) { return pev->impulse; }
inline void ExplosionSetMagnitude( int magnitude ) { pev->impulse = magnitude; } inline void ExplosionSetMagnitude( int magnitude ) { pev->impulse = magnitude; }
static void MaterialSoundPrecache( Materials precacheMaterial ); static void MaterialSoundPrecache( Materials precacheMaterial );
static void MaterialSoundRandom( edict_t *pEdict, Materials soundMaterial, float volume ); static void MaterialSoundRandom( edict_t *pEdict, Materials soundMaterial, float volume );
static const char **MaterialSoundList( Materials precacheMaterial, int &soundCount ); static const char **MaterialSoundList( Materials precacheMaterial, int &soundCount );
@ -197,8 +195,7 @@ public:
int m_iaCustomAnglesX[10]; int m_iaCustomAnglesX[10];
int m_iaCustomAnglesZ[10]; int m_iaCustomAnglesZ[10];
}; };
LINK_ENTITY_TO_CLASS(prop, CProp);
LINK_ENTITY_TO_CLASS( prop, CProp )
const char *CProp::pSoundsWood[] = const char *CProp::pSoundsWood[] =
{ {
@ -231,6 +228,7 @@ const char *CProp::pSoundsConcrete[] =
"debris/concrete3.wav", "debris/concrete3.wav",
}; };
const char *CProp::pSoundsGlass[] = const char *CProp::pSoundsGlass[] =
{ {
"debris/glass1.wav", "debris/glass1.wav",
@ -258,15 +256,19 @@ const char **CProp::MaterialSoundList( Materials precacheMaterial, int &soundCou
pSoundList = pSoundsGlass; pSoundList = pSoundsGlass;
soundCount = ARRAYSIZE(pSoundsGlass); soundCount = ARRAYSIZE(pSoundsGlass);
break; break;
case matMetal: case matMetal:
pSoundList = pSoundsMetal; pSoundList = pSoundsMetal;
soundCount = ARRAYSIZE(pSoundsMetal); soundCount = ARRAYSIZE(pSoundsMetal);
break; break;
case matCinderBlock: case matCinderBlock:
case matRocks: case matRocks:
pSoundList = pSoundsConcrete; pSoundList = pSoundsConcrete;
soundCount = ARRAYSIZE(pSoundsConcrete); soundCount = ARRAYSIZE(pSoundsConcrete);
break; break;
case matCeilingTile: case matCeilingTile:
case matNone: case matNone:
default: default:
@ -330,6 +332,7 @@ void CProp::Precache( void )
PRECACHE_SOUND("debris/bustmetal1.wav"); PRECACHE_SOUND("debris/bustmetal1.wav");
PRECACHE_SOUND("debris/bustmetal2.wav"); PRECACHE_SOUND("debris/bustmetal2.wav");
break; break;
case matUnbreakableGlass: case matUnbreakableGlass:
case matGlass: case matGlass:
pGibName = "models/glassgibs.mdl"; pGibName = "models/glassgibs.mdl";
@ -400,18 +403,21 @@ void CProp::DamageSound( void )
rgpsz[2] = "debris/glass3.wav"; rgpsz[2] = "debris/glass3.wav";
i = 3; i = 3;
break; break;
case matWood: case matWood:
rgpsz[0] = "debris/wood1.wav"; rgpsz[0] = "debris/wood1.wav";
rgpsz[1] = "debris/wood2.wav"; rgpsz[1] = "debris/wood2.wav";
rgpsz[2] = "debris/wood3.wav"; rgpsz[2] = "debris/wood3.wav";
i = 3; i = 3;
break; break;
case matMetal: case matMetal:
rgpsz[0] = "debris/metal1.wav"; rgpsz[0] = "debris/metal1.wav";
rgpsz[1] = "debris/metal3.wav"; rgpsz[1] = "debris/metal3.wav";
rgpsz[2] = "debris/metal2.wav"; rgpsz[2] = "debris/metal2.wav";
i = 2; i = 2;
break; break;
case matFlesh: case matFlesh:
rgpsz[0] = "debris/flesh1.wav"; rgpsz[0] = "debris/flesh1.wav";
rgpsz[1] = "debris/flesh2.wav"; rgpsz[1] = "debris/flesh2.wav";
@ -421,6 +427,7 @@ void CProp::DamageSound( void )
rgpsz[5] = "debris/flesh7.wav"; rgpsz[5] = "debris/flesh7.wav";
i = 6; i = 6;
break; break;
case matRocks: case matRocks:
case matCinderBlock: case matCinderBlock:
rgpsz[0] = "debris/concrete1.wav"; rgpsz[0] = "debris/concrete1.wav";
@ -428,6 +435,7 @@ void CProp::DamageSound( void )
rgpsz[2] = "debris/concrete3.wav"; rgpsz[2] = "debris/concrete3.wav";
i = 3; i = 3;
break; break;
case matCeilingTile: case matCeilingTile:
// UNDONE: no ceiling tile shard sound yet // UNDONE: no ceiling tile shard sound yet
i = 0; i = 0;
@ -459,75 +467,72 @@ void CProp::Die( void )
if (fvol > 1.0) if (fvol > 1.0)
fvol = 1.0; fvol = 1.0;
switch (m_Material) switch (m_Material)
{ {
case matGlass: case matGlass:
switch ( RANDOM_LONG(0,1) ) switch ( RANDOM_LONG(0,1) )
{ {
case 0: case 0: EMIT_SOUND_DYN(ENT(pev), CHAN_VOICE, "debris/bustglass1.wav", fvol, ATTN_NORM, 0, pitch);
EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "debris/bustglass1.wav", fvol, ATTN_NORM, 0, pitch );
break; break;
case 1: case 1: EMIT_SOUND_DYN(ENT(pev), CHAN_VOICE, "debris/bustglass2.wav", fvol, ATTN_NORM, 0, pitch);
EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "debris/bustglass2.wav", fvol, ATTN_NORM, 0, pitch );
break; break;
} }
cFlag = BREAK_GLASS; cFlag = BREAK_GLASS;
break; break;
case matWood: case matWood:
switch ( RANDOM_LONG(0,1) ) switch ( RANDOM_LONG(0,1) )
{ {
case 0: case 0: EMIT_SOUND_DYN(ENT(pev), CHAN_VOICE, "debris/bustcrate1.wav", fvol, ATTN_NORM, 0, pitch);
EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "debris/bustcrate1.wav", fvol, ATTN_NORM, 0, pitch );
break; break;
case 1: case 1: EMIT_SOUND_DYN(ENT(pev), CHAN_VOICE, "debris/bustcrate2.wav", fvol, ATTN_NORM, 0, pitch);
EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "debris/bustcrate2.wav", fvol, ATTN_NORM, 0, pitch );
break; break;
} }
cFlag = BREAK_WOOD; cFlag = BREAK_WOOD;
break; break;
case matComputer: case matComputer:
case matMetal: case matMetal:
switch ( RANDOM_LONG(0,1) ) switch ( RANDOM_LONG(0,1) )
{ {
case 0: case 0: EMIT_SOUND_DYN(ENT(pev), CHAN_VOICE, "debris/bustmetal1.wav", fvol, ATTN_NORM, 0, pitch);
EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "debris/bustmetal1.wav", fvol, ATTN_NORM, 0, pitch );
break; break;
case 1: case 1: EMIT_SOUND_DYN(ENT(pev), CHAN_VOICE, "debris/bustmetal2.wav", fvol, ATTN_NORM, 0, pitch);
EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "debris/bustmetal2.wav", fvol, ATTN_NORM, 0, pitch );
break; break;
} }
cFlag = BREAK_METAL; cFlag = BREAK_METAL;
break; break;
case matFlesh: case matFlesh:
switch ( RANDOM_LONG(0,1) ) switch ( RANDOM_LONG(0,1) )
{ {
case 0: case 0: EMIT_SOUND_DYN(ENT(pev), CHAN_VOICE, "debris/bustflesh1.wav", fvol, ATTN_NORM, 0, pitch);
EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "debris/bustflesh1.wav", fvol, ATTN_NORM, 0, pitch );
break; break;
case 1: case 1: EMIT_SOUND_DYN(ENT(pev), CHAN_VOICE, "debris/bustflesh2.wav", fvol, ATTN_NORM, 0, pitch);
EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "debris/bustflesh2.wav", fvol, ATTN_NORM, 0, pitch );
break; break;
} }
cFlag = BREAK_FLESH; cFlag = BREAK_FLESH;
break; break;
case matRocks: case matRocks:
case matCinderBlock: case matCinderBlock:
switch ( RANDOM_LONG(0,1) ) switch ( RANDOM_LONG(0,1) )
{ {
case 0: case 0: EMIT_SOUND_DYN(ENT(pev), CHAN_VOICE, "debris/bustconcrete1.wav", fvol, ATTN_NORM, 0, pitch);
EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "debris/bustconcrete1.wav", fvol, ATTN_NORM, 0, pitch );
break; break;
case 1: case 1: EMIT_SOUND_DYN(ENT(pev), CHAN_VOICE, "debris/bustconcrete2.wav", fvol, ATTN_NORM, 0, pitch);
EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "debris/bustconcrete2.wav", fvol, ATTN_NORM, 0, pitch );
break; break;
} }
cFlag = BREAK_CONCRETE; cFlag = BREAK_CONCRETE;
break; break;
case matCeilingTile: 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; break;
} }
if (m_Explosion == expDirected) if (m_Explosion == expDirected)
vecVelocity = g_vecAttackDir * 200; vecVelocity = g_vecAttackDir * 200;
else else
@ -601,7 +606,6 @@ void CProp::Die( void )
pev->targetname = 0; pev->targetname = 0;
pev->solid = SOLID_NOT; pev->solid = SOLID_NOT;
// Fire targets on break // Fire targets on break
SUB_UseTargets( NULL, USE_TOGGLE, 0 ); SUB_UseTargets( NULL, USE_TOGGLE, 0 );
@ -669,7 +673,6 @@ void CProp::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType
pev->nextthink = gpGlobals->time + 0.2; pev->nextthink = gpGlobals->time + 0.2;
} }
} }
Vector target = pActivator->pev->origin + UTIL_GetAimVector(m_owner2->edict(), 1000) * 50; Vector target = pActivator->pev->origin + UTIL_GetAimVector(m_owner2->edict(), 1000) * 50;
target.z = target.z + 32; target.z = target.z + 32;
pev->velocity = (target - VecBModelOrigin(pev)) * 10; pev->velocity = (target - VecBModelOrigin(pev)) * 10;
@ -737,13 +740,15 @@ void CProp::CheckRotate()
UTIL_SetSize(pev, minsH, maxsH); UTIL_SetSize(pev, minsH, maxsH);
return; 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; m_shape = SHAPE_CYL_H;
else else
m_shape = SHAPE_CYL_V; 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; pev->angles.y += 90;
@ -841,7 +846,6 @@ void CProp::BounceTouch( CBaseEntity *pOther )
} }
m_flNextAttack = gpGlobals->time + 1.0; // debounce m_flNextAttack = gpGlobals->time + 1.0; // debounce
} }
if( (pOther != m_owner2) && (pev->spawnflags & SF_PROP_BREAKABLE) && (pev->velocity.Length() > 1800) ) if( (pOther != m_owner2) && (pev->spawnflags & SF_PROP_BREAKABLE) && (pev->velocity.Length() > 1800) )
{ {
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
@ -855,6 +859,7 @@ void CProp::BounceTouch( CBaseEntity *pOther )
CheckRotate(); CheckRotate();
if (m_shape == SHAPE_CYL_H) if (m_shape == SHAPE_CYL_H)
{ {
pev->velocity.x *= 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.y *= fabs(dp) * 0.8 + 0.2;
pev->velocity.z -= 20; pev->velocity.z -= 20;
@ -890,6 +895,7 @@ void CProp::BounceTouch( CBaseEntity *pOther )
pev->velocity.y *= m_flFloorFriction; pev->velocity.y *= m_flFloorFriction;
pev->velocity.z -= 10; pev->velocity.z -= 10;
} }
} }
else else
{ {
@ -924,20 +930,15 @@ void CProp::BounceSound( void )
{ {
switch (RANDOM_LONG(0, 2)) switch (RANDOM_LONG(0, 2))
{ {
case 0: case 0: EMIT_SOUND(ENT(pev), CHAN_VOICE, "weapons/grenade_hit1.wav", 0.25, ATTN_NORM); break;
EMIT_SOUND( ENT( pev ), CHAN_VOICE, "weapons/grenade_hit1.wav", 0.25, ATTN_NORM ); case 1: EMIT_SOUND(ENT(pev), CHAN_VOICE, "weapons/grenade_hit2.wav", 0.25, ATTN_NORM); break;
break; case 2: EMIT_SOUND(ENT(pev), CHAN_VOICE, "weapons/grenade_hit3.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(); Precache();
if( minsH == g_vecZero ) if( minsH == g_vecZero )
@ -1011,6 +1012,8 @@ void CProp::RespawnThink()
PropRespawn(); PropRespawn();
} }
void CProp::AngleThink() void CProp::AngleThink()
{ {
pev->nextthink = gpGlobals->time + m_flRespawnTime; pev->nextthink = gpGlobals->time + m_flRespawnTime;
@ -1082,7 +1085,6 @@ void CProp::AngleThink()
int i; int i;
// if first number is zero, it is angle // if first number is zero, it is angle
// all other zeroes is array end // all other zeroes is array end
for( i = 0; (i < 10) && ( (i == 0 ) || m_iaCustomAnglesX[i] ); i++) 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]));
@ -1093,7 +1095,6 @@ void CProp::AngleThink()
} }
} }
imaxanglediff=360.0f; imaxanglediff=360.0f;
for( i = 0; (i < 10) && ( (i == 0 ) || m_iaCustomAnglesZ[i] ); i++) 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]));
@ -1138,6 +1139,7 @@ int CProp::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, float fl
ALERT(at_console, "Takedmg: %s %s %f %f\n", STRING(pevInflictor->classname), STRING(pevAttacker->classname), flDamage, pev->health ); ALERT(at_console, "Takedmg: %s %s %f %f\n", STRING(pevInflictor->classname), STRING(pevAttacker->classname), flDamage, pev->health );
// now some func_breakable code // now some func_breakable code
if ( !(pev->spawnflags & SF_PROP_BREAKABLE ) ) if ( !(pev->spawnflags & SF_PROP_BREAKABLE ) )
return 0; return 0;
if ( pev->health <= 0 ) if ( pev->health <= 0 )
@ -1163,10 +1165,10 @@ int CProp::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, float fl
// Make a shard noise each time func breakable is hit. // Make a shard noise each time func breakable is hit.
// Don't play shard noise if cbreakable actually died. // Don't play shard noise if cbreakable actually died.
DamageSound(); DamageSound();
return 1; return 1;
} }
void CProp::KeyValue( KeyValueData* pkvd ) 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);

View File

@ -350,7 +350,7 @@ void W_Precache( void )
// hornetgun // hornetgun
UTIL_PrecacheOtherWeapon( "weapon_hornetgun" ); UTIL_PrecacheOtherWeapon( "weapon_hornetgun" );
#endif
UTIL_PrecacheOtherWeapon( "weapon_gravgun" ); UTIL_PrecacheOtherWeapon( "weapon_gravgun" );
UTIL_PrecacheOtherWeapon( "weapon_ar2" ); UTIL_PrecacheOtherWeapon( "weapon_ar2" );