Fix entvars keyvalues not working.

Fix monstermaker classname.
This commit is contained in:
Giegue
2023-03-25 21:46:22 -03:00
parent b757c65345
commit c813f6e76a
3 changed files with 3 additions and 11 deletions

View File

@@ -111,12 +111,8 @@ void CMBaseEntity :: KeyValue( KeyValueData* pkvd )
if ( !pev || !pkvd ) if ( !pev || !pkvd )
return; return;
if ( pkvd->fHandled )
{
// only handled data contain readable strings
EntvarsKeyvalue( pev, pkvd ); EntvarsKeyvalue( pev, pkvd );
} }
}
// give health // give health
int CMBaseEntity :: TakeHealth( float flHealth, int bitsDamageType ) int CMBaseEntity :: TakeHealth( float flHealth, int bitsDamageType )

View File

@@ -109,6 +109,7 @@ void CMMonsterMaker :: Spawn( )
m_fFadeChildren = TRUE; m_fFadeChildren = TRUE;
m_flGround = 0; m_flGround = 0;
pev->classname = MAKE_STRING("monstermaker");
} }
void CMMonsterMaker :: Precache( void ) void CMMonsterMaker :: Precache( void )
@@ -169,7 +170,7 @@ void CMMonsterMaker::MakeMonster( void )
pent = spawn_monster(m_iMonsterIndex, pev->origin, pev->angles, createSF, keyvalue); pent = spawn_monster(m_iMonsterIndex, pev->origin, pev->angles, createSF, keyvalue);
if ( pent == NULL ) if ( pent == NULL )
{ {
ALERT ( at_console, "NULL Ent in MonsterMaker!\n" ); ALERT ( at_console, "[MONSTER] NULL Ent in MonsterMaker!\n" );
return; return;
} }

View File

@@ -2626,11 +2626,6 @@ void CMBaseMonster :: KeyValue( KeyValueData *pkvd )
m_iClassifyOverride = atoi( pkvd->szValue ); m_iClassifyOverride = atoi( pkvd->szValue );
pkvd->fHandled = TRUE; pkvd->fHandled = TRUE;
} }
else if (FStrEq(pkvd->szKeyName, "model"))
{
pev->model = ALLOC_STRING( pkvd->szValue );
pkvd->fHandled = TRUE;
}
else else
{ {
CMBaseToggle::KeyValue( pkvd ); CMBaseToggle::KeyValue( pkvd );