mirror of https://github.com/FWGS/hlsdk-xash3d
Add kludge for Uplink's scientist model.
This commit is contained in:
parent
1f458edb0b
commit
738890287b
|
@ -29,6 +29,8 @@
|
|||
|
||||
#define NUM_SCIENTIST_HEADS 4 // four heads available for scientist model
|
||||
|
||||
static cvar_t *g_psv_override_scientist_mdl;
|
||||
|
||||
enum
|
||||
{
|
||||
HEAD_GLASSES = 0,
|
||||
|
@ -113,6 +115,8 @@ public:
|
|||
CUSTOM_SCHEDULES
|
||||
|
||||
private:
|
||||
const char *GetScientistModel( void );
|
||||
|
||||
float m_painTime;
|
||||
float m_healTime;
|
||||
float m_fearTime;
|
||||
|
@ -422,6 +426,20 @@ void CScientist::DeclineFollowing( void )
|
|||
PlaySentence( "SC_POK", 2, VOL_NORM, ATTN_NORM );
|
||||
}
|
||||
|
||||
const char *CScientist::GetScientistModel( void )
|
||||
{
|
||||
if( !g_psv_override_scientist_mdl )
|
||||
g_psv_override_scientist_mdl = CVAR_GET_POINTER( "_sv_override_scientist_mdl" );
|
||||
|
||||
if( !( g_psv_override_scientist_mdl && g_psv_override_scientist_mdl->string ))
|
||||
return "models/scientist.mdl";
|
||||
|
||||
if( strlen( g_psv_override_scientist_mdl->string ) < sizeof( "01.mdl" ) - 1 )
|
||||
return "models/scientist.mdl";
|
||||
|
||||
return g_psv_override_scientist_mdl->string;
|
||||
}
|
||||
|
||||
void CScientist::Scream( void )
|
||||
{
|
||||
if( FOkToSpeak() )
|
||||
|
@ -648,7 +666,7 @@ void CScientist::Spawn( void )
|
|||
|
||||
Precache();
|
||||
|
||||
SET_MODEL( ENT( pev ), "models/scientist.mdl" );
|
||||
SET_MODEL( ENT( pev ), GetScientistModel());
|
||||
UTIL_SetSize( pev, VEC_HUMAN_HULL_MIN, VEC_HUMAN_HULL_MAX );
|
||||
|
||||
pev->solid = SOLID_SLIDEBOX;
|
||||
|
@ -679,7 +697,7 @@ void CScientist::Spawn( void )
|
|||
//=========================================================
|
||||
void CScientist::Precache( void )
|
||||
{
|
||||
PRECACHE_MODEL( "models/scientist.mdl" );
|
||||
PRECACHE_MODEL( GetScientistModel());
|
||||
PRECACHE_SOUND( "scientist/sci_pain1.wav" );
|
||||
PRECACHE_SOUND( "scientist/sci_pain2.wav" );
|
||||
PRECACHE_SOUND( "scientist/sci_pain3.wav" );
|
||||
|
@ -1097,6 +1115,9 @@ public:
|
|||
void KeyValue( KeyValueData *pkvd );
|
||||
int m_iPose;// which sequence to display
|
||||
static const char *m_szPoses[7];
|
||||
|
||||
private:
|
||||
const char *GetScientistModel( void );
|
||||
};
|
||||
|
||||
const char *CDeadScientist::m_szPoses[] =
|
||||
|
@ -1127,8 +1148,10 @@ LINK_ENTITY_TO_CLASS( monster_scientist_dead, CDeadScientist )
|
|||
//
|
||||
void CDeadScientist::Spawn()
|
||||
{
|
||||
PRECACHE_MODEL( "models/scientist.mdl" );
|
||||
SET_MODEL( ENT( pev ), "models/scientist.mdl" );
|
||||
const char *pszModel = GetScientistModel();
|
||||
|
||||
PRECACHE_MODEL( pszModel );
|
||||
SET_MODEL( ENT( pev ), pszModel );
|
||||
|
||||
pev->effects = 0;
|
||||
pev->sequence = 0;
|
||||
|
@ -1160,6 +1183,20 @@ void CDeadScientist::Spawn()
|
|||
MonsterInitDead();
|
||||
}
|
||||
|
||||
const char *CDeadScientist::GetScientistModel( void )
|
||||
{
|
||||
if( !g_psv_override_scientist_mdl )
|
||||
g_psv_override_scientist_mdl = CVAR_GET_POINTER( "_sv_override_scientist_mdl" );
|
||||
|
||||
if( !( g_psv_override_scientist_mdl && g_psv_override_scientist_mdl->string ))
|
||||
return "models/scientist.mdl";
|
||||
|
||||
if( strlen( g_psv_override_scientist_mdl->string ) < sizeof( "01.mdl" ) - 1 )
|
||||
return "models/scientist.mdl";
|
||||
|
||||
return g_psv_override_scientist_mdl->string;
|
||||
}
|
||||
|
||||
//=========================================================
|
||||
// Sitting Scientist PROP
|
||||
//=========================================================
|
||||
|
|
Loading…
Reference in New Issue