Skip to content

Commit

Permalink
Reorder functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
nekonomicon committed Feb 22, 2025
1 parent 563938b commit 8554dc1
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 23 deletions.
3 changes: 1 addition & 2 deletions dlls/h_cycler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,12 @@ class CCycler : public CBaseMonster

// Don't treat as a live target
virtual BOOL IsAlive( void ) { return FALSE; }
BOOL IsAllowedToSpeak( void ) { return TRUE; }

virtual int Save( CSave &save );
virtual int Restore( CRestore &restore );
static TYPEDESCRIPTION m_SaveData[];

BOOL IsAllowedToSpeak( void ) { return TRUE; }

int m_animate;
};

Expand Down
42 changes: 21 additions & 21 deletions dlls/subs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,27 @@ BOOL CBaseToggle::IsLockedByMaster( void )
return FALSE;
}

void CBaseToggle::PlaySentence( const char *pszSentence, float duration, float volume, float attenuation )
{
if( pszSentence && IsAllowedToSpeak())
{
if( pszSentence[0] == '!' )
EMIT_SOUND_DYN( edict(), CHAN_VOICE, pszSentence, volume, attenuation, 0, PITCH_NORM );
else
SENTENCEG_PlayRndSz( edict(), pszSentence, volume, attenuation, 0, PITCH_NORM );
}
}

void CBaseToggle::PlayScriptedSentence( const char *pszSentence, float duration, float volume, float attenuation, BOOL bConcurrent, CBaseEntity *pListener )
{
PlaySentence( pszSentence, duration, volume, attenuation );
}

void CBaseToggle::SentenceStop( void )
{
EMIT_SOUND( edict(), CHAN_VOICE, "common/null.wav", 1.0, ATTN_IDLE );
}

/*
=============
AngularMove
Expand Down Expand Up @@ -520,27 +541,6 @@ float CBaseToggle::AxisDelta( int flags, const Vector &angle1, const Vector &ang
return angle1.y - angle2.y;
}

void CBaseToggle::PlaySentence( const char *pszSentence, float duration, float volume, float attenuation )
{
if( pszSentence && IsAllowedToSpeak())
{
if( pszSentence[0] == '!' )
EMIT_SOUND_DYN( edict(), CHAN_VOICE, pszSentence, volume, attenuation, 0, PITCH_NORM );
else
SENTENCEG_PlayRndSz( edict(), pszSentence, volume, attenuation, 0, PITCH_NORM );
}
}

void CBaseToggle::PlayScriptedSentence( const char *pszSentence, float duration, float volume, float attenuation, BOOL bConcurrent, CBaseEntity *pListener )
{
PlaySentence( pszSentence, duration, volume, attenuation );
}

void CBaseToggle::SentenceStop( void )
{
EMIT_SOUND( edict(), CHAN_VOICE, "common/null.wav", 1.0, ATTN_IDLE );
}

/*
=============
FEntIsVisible
Expand Down

0 comments on commit 8554dc1

Please sign in to comment.