Added checks for the strider template

This commit is contained in:
Bronzehawk75 2024-02-18 21:16:43 -05:00
parent 0a16eb993f
commit e0a1904693

View File

@ -985,6 +985,11 @@ void CNPC_CombineDropship::Spawn( void )
if ( m_sStriderTemplate != NULL_STRING ) if ( m_sStriderTemplate != NULL_STRING )
{ {
m_sStriderTemplateData = Templates_FindByTargetName( STRING( m_sStriderTemplate ) ); m_sStriderTemplateData = Templates_FindByTargetName( STRING( m_sStriderTemplate ) );
if (m_sStriderTemplateData == NULL_STRING)
{
Warning("npc_combinedropship %s: Strider Template %s not found!\n", STRING(GetEntityName()), STRING(m_sStriderTemplate));
break;
}
CAI_BaseNPC* pent = NULL; CAI_BaseNPC* pent = NULL;
CBaseEntity* pEntity = NULL; CBaseEntity* pEntity = NULL;
@ -994,6 +999,12 @@ void CNPC_CombineDropship::Spawn( void )
pent = ( CAI_BaseNPC* )pEntity; pent = ( CAI_BaseNPC* )pEntity;
} }
if ( !FClassnameIs(pent, "npc_strider"))
{
Warning("npc_combinedropship %s: Strider Template %s is not a strider!\n", STRING(GetEntityName()), STRING(m_sStriderTemplate));
break;
}
m_OnSpawnNPC.Set( pEntity, pEntity, this ); m_OnSpawnNPC.Set( pEntity, pEntity, this );
pent->RemoveSpawnFlags( SF_NPC_TEMPLATE ); pent->RemoveSpawnFlags( SF_NPC_TEMPLATE );