mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-17 18:40:02 +00:00
engine: client: call SND_ForceOpen/CloseMouth within SND_Open/CloseMouth to avoid copypasted code
This commit is contained in:
parent
801dbaa387
commit
327372e253
@ -24,17 +24,7 @@ void SND_InitMouth( int entnum, int entchannel )
|
|||||||
{
|
{
|
||||||
if(( entchannel == CHAN_VOICE || entchannel == CHAN_STREAM ) && entnum > 0 )
|
if(( entchannel == CHAN_VOICE || entchannel == CHAN_STREAM ) && entnum > 0 )
|
||||||
{
|
{
|
||||||
cl_entity_t *clientEntity;
|
SND_ForceInitMouth( entnum );
|
||||||
|
|
||||||
// init mouth movement vars
|
|
||||||
clientEntity = CL_GetEntityByIndex( entnum );
|
|
||||||
|
|
||||||
if( clientEntity )
|
|
||||||
{
|
|
||||||
clientEntity->mouth.mouthopen = 0;
|
|
||||||
clientEntity->mouth.sndcount = 0;
|
|
||||||
clientEntity->mouth.sndavg = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -42,15 +32,7 @@ void SND_CloseMouth( channel_t *ch )
|
|||||||
{
|
{
|
||||||
if( ch->entchannel == CHAN_VOICE || ch->entchannel == CHAN_STREAM )
|
if( ch->entchannel == CHAN_VOICE || ch->entchannel == CHAN_STREAM )
|
||||||
{
|
{
|
||||||
cl_entity_t *clientEntity;
|
SND_ForceCloseMouth( ch->entnum );
|
||||||
|
|
||||||
clientEntity = CL_GetEntityByIndex( ch->entnum );
|
|
||||||
|
|
||||||
if( clientEntity )
|
|
||||||
{
|
|
||||||
// shut mouth
|
|
||||||
clientEntity->mouth.mouthopen = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -157,7 +139,7 @@ void SND_ForceInitMouth( int entnum )
|
|||||||
|
|
||||||
clientEntity = CL_GetEntityByIndex( entnum );
|
clientEntity = CL_GetEntityByIndex( entnum );
|
||||||
|
|
||||||
if ( clientEntity )
|
if( clientEntity )
|
||||||
{
|
{
|
||||||
clientEntity->mouth.mouthopen = 0;
|
clientEntity->mouth.mouthopen = 0;
|
||||||
clientEntity->mouth.sndavg = 0;
|
clientEntity->mouth.sndavg = 0;
|
||||||
@ -171,7 +153,7 @@ void SND_ForceCloseMouth( int entnum )
|
|||||||
|
|
||||||
clientEntity = CL_GetEntityByIndex( entnum );
|
clientEntity = CL_GetEntityByIndex( entnum );
|
||||||
|
|
||||||
if ( clientEntity )
|
if( clientEntity )
|
||||||
clientEntity->mouth.mouthopen = 0;
|
clientEntity->mouth.mouthopen = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -214,4 +196,4 @@ void SND_MoveMouthRaw( rawchan_t *ch, portable_samplepair_t *pData, int count )
|
|||||||
pMouth->sndavg = 0;
|
pMouth->sndavg = 0;
|
||||||
pMouth->sndcount = 0;
|
pMouth->sndcount = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user