Fix scientist's voice pitch selection (#292)

This commit is contained in:
Roman Chistokhodov 2022-07-22 15:56:02 +03:00 committed by GitHub
parent 3b0046cb3d
commit b69d37e30e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 7 deletions

View File

@ -639,6 +639,13 @@ void CScientist::HandleAnimEvent( MonsterEvent_t *pEvent )
//=========================================================
void CScientist::Spawn( void )
{
// We need to set it before precache so the right voice will be chosen
if( pev->body == -1 )
{
// -1 chooses a random head
pev->body = RANDOM_LONG( 0, NUM_SCIENTIST_HEADS - 1 );// pick a head, any head
}
Precache();
SET_MODEL( ENT( pev ), "models/scientist.mdl" );
@ -659,12 +666,6 @@ void CScientist::Spawn( void )
// White hands
pev->skin = 0;
if( pev->body == -1 )
{
// -1 chooses a random head
pev->body = RANDOM_LONG( 0, NUM_SCIENTIST_HEADS - 1 );// pick a head, any head
}
// Luther is black, make his hands black
if( pev->body == HEAD_LUTHER )
pev->skin = 1;
@ -722,7 +723,7 @@ void CScientist::TalkInit()
m_szGrp[TLK_MORTAL] = "SC_MORTAL";
// get voice for head
switch( pev->body % 3 )
switch( pev->body % NUM_SCIENTIST_HEADS )
{
default:
case HEAD_GLASSES: