Skip to content

Commit

Permalink
Remove IsMachine. Add HasFlesh
Browse files Browse the repository at this point in the history
  • Loading branch information
FreeSlave committed Nov 7, 2024
1 parent 545815e commit c8a3562
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion dlls/apache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class CApache : public CBaseMonster
void Precache( void );
void KeyValue(KeyValueData* pkvd);
int DefaultClassify( void ) { return CLASS_HUMAN_MILITARY; }
bool IsMachine() { return true; }
bool HasFlesh() { return false; }
const char* DefaultDisplayName() { return "Apache"; }
const char* ReverseRelationshipModel() { return "models/apachef.mdl"; }
int BloodColor( void ) { return DONT_BLEED; }
Expand Down
2 changes: 1 addition & 1 deletion dlls/cbase.h
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ class CBaseEntity
virtual CBasePlayerAmmo* MyAmmoPointer() {return NULL;}

virtual bool IsAlienMonster() { return false; }
virtual bool IsMachine() { return DefaultClassify() == CLASS_MACHINE; }
virtual bool HasFlesh() { return DefaultClassify() != CLASS_NONE && DefaultClassify() != CLASS_MACHINE; }
virtual float InputByMonster(CBaseMonster* pMonster) { return 0.0f; }
virtual NODE_LINKENT HandleLinkEnt(int afCapMask, bool nodeQueryStatic) { return NLE_PROHIBIT; }

Expand Down
3 changes: 1 addition & 2 deletions dlls/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1472,8 +1472,7 @@ int AddToFullPack( struct entity_state_s *state, int e, edict_t *ent, edict_t *h
}

if( ( Entity = CBaseEntity::Instance( ent ))
&& Entity->DefaultClassify() != CLASS_NONE
&& Entity->DefaultClassify() != CLASS_MACHINE )
&& Entity->HasFlesh() )
{
SetBits( state->eflags, EFLAG_FLESH_SOUND );
}
Expand Down
2 changes: 1 addition & 1 deletion dlls/crowbar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ int CCrowbar::Swing( int fFirst )
}
ApplyMultiDamage( m_pPlayer->pev, m_pPlayer->pev );

if( pEntity->DefaultClassify() != CLASS_NONE && !pEntity->IsMachine() )
if( pEntity->HasFlesh() )
{
// play thwack or smack sound
switch( RANDOM_LONG( 0, 2 ) )
Expand Down
4 changes: 2 additions & 2 deletions dlls/knife.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ int CKnife::Swing(int fFirst)
}
ApplyMultiDamage( m_pPlayer->pev, m_pPlayer->pev );

if( pEntity->DefaultClassify() != CLASS_NONE && !pEntity->IsMachine() )
if( pEntity->HasFlesh() )
{
// play thwack or smack sound
switch( RANDOM_LONG( 0, 1 ) )
Expand Down Expand Up @@ -373,7 +373,7 @@ void CKnife::Stab()

if (pEntity)
{
if (pEntity->DefaultClassify() != CLASS_NONE && !pEntity->IsMachine())
if (pEntity->HasFlesh())
{
// play thwack or smack sound
switch( RANDOM_LONG(0,1) )
Expand Down
4 changes: 2 additions & 2 deletions dlls/pipewrench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ int CPipeWrench::Swing(int fFirst)

ApplyMultiDamage(m_pPlayer->pev, m_pPlayer->pev);

if ( pEntity->DefaultClassify() != CLASS_NONE && !pEntity->IsMachine() )
if ( pEntity->HasFlesh() )
{
// play thwack or smack sound
switch( RANDOM_LONG(0,2) )
Expand Down Expand Up @@ -381,7 +381,7 @@ void CPipeWrench::BigSwing(void)

if (pEntity)
{
if (pEntity->DefaultClassify() != CLASS_NONE && !pEntity->IsMachine())
if (pEntity->HasFlesh())
{
// play thwack or smack sound
switch( RANDOM_LONG(0,1) )
Expand Down
2 changes: 1 addition & 1 deletion dlls/sound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1821,7 +1821,7 @@ float TEXTURETYPE_PlaySound( TraceResult *ptr, Vector vecSrc, Vector vecEnd, in

chTextureType = 0;

if( pEntity && pEntity->DefaultClassify() != CLASS_NONE && !pEntity->IsMachine() )
if( pEntity && pEntity->HasFlesh() )
// hit body
chTextureType = CHAR_TEX_FLESH;
else
Expand Down

0 comments on commit c8a3562

Please sign in to comment.