Fixed missing garg death effects.

This commit is contained in:
Julian
2020-03-12 22:33:46 -03:00
parent 2dc08ad132
commit cf98a583e3
2 changed files with 17 additions and 7 deletions

View File

@@ -87,6 +87,7 @@ public:
void Spawn( ); void Spawn( );
void EXPORT Smoke ( void ); void EXPORT Smoke ( void );
void KeyValue( KeyValueData *pkvd ); void KeyValue( KeyValueData *pkvd );
void DelayUse( void );
void Use( CMBaseEntity *pActivator, CMBaseEntity *pCaller, USE_TYPE useType, float value ); void Use( CMBaseEntity *pActivator, CMBaseEntity *pCaller, USE_TYPE useType, float value );
int m_iMagnitude;// how large is the fireball? how much damage? int m_iMagnitude;// how large is the fireball? how much damage?
@@ -135,6 +136,11 @@ void CMEnvExplosion::Spawn( void )
pev->classname = MAKE_STRING( "_env_explosion" ); pev->classname = MAKE_STRING( "_env_explosion" );
} }
void CMEnvExplosion::DelayUse( void )
{
Use( NULL, NULL, USE_TOGGLE, 0 );
}
void CMEnvExplosion::Use( CMBaseEntity *pActivator, CMBaseEntity *pCaller, USE_TYPE useType, float value ) void CMEnvExplosion::Use( CMBaseEntity *pActivator, CMBaseEntity *pCaller, USE_TYPE useType, float value )
{ {
TraceResult tr; TraceResult tr;
@@ -274,18 +280,20 @@ void ExplosionCreate( const Vector &center, const Vector &angles, edict_t *pOwne
pExplosion->pev->owner = pOwner; pExplosion->pev->owner = pOwner;
pExplosion->pev->spawnflags |= flags; pExplosion->pev->spawnflags |= flags;
UTIL_SetOrigin( pExplosion->pev, center );
pExplosion->pev->angles = angles;
// This is a temporary entity, filter out the flag // This is a temporary entity, filter out the flag
pExplosion->pev->spawnflags &= ~SF_ENVEXPLOSION_REPEATABLE; pExplosion->pev->spawnflags &= ~SF_ENVEXPLOSION_REPEATABLE;
pExplosion->Spawn();
if ( delay > 0.0f ) if ( delay > 0.0f )
{ {
pExplosion->SetThink( &CMBaseEntity::SUB_CallUseToggle ); //pExplosion->SetThink( &CMBaseEntity::SUB_CallUseToggle ); // i don't trust you
pExplosion->SetThink( &CMEnvExplosion::DelayUse );
pExplosion->pev->nextthink = gpGlobals->time + delay; pExplosion->pev->nextthink = gpGlobals->time + delay;
} }
else
pExplosion->Spawn();
if ( delay <= 0.0f )
{ {
pExplosion->Use( NULL, NULL, USE_TOGGLE, 0 ); pExplosion->Use( NULL, NULL, USE_TOGGLE, 0 );
} }

View File

@@ -796,7 +796,7 @@ void CMGargantua::DeathEffect( void )
{ {
int i; int i;
UTIL_MakeVectors(pev->angles); UTIL_MakeVectors(pev->angles);
Vector deathPos = pev->origin + gpGlobals->v_forward * 100; Vector deathPos = pev->origin + gpGlobals->v_up * 100;
// Create a spiral of streaks // Create a spiral of streaks
CSpiral::Create( deathPos, (pev->absmax.z - pev->absmin.z) * 0.6, 125, 1.5 ); CSpiral::Create( deathPos, (pev->absmax.z - pev->absmin.z) * 0.6, 125, 1.5 );
@@ -810,6 +810,8 @@ void CMGargantua::DeathEffect( void )
} }
CMBaseEntity *pSmoker = CreateClassPtr((CSmoker *)NULL); // CMBaseEntity::Create( "env_smoker", pev->origin, g_vecZero, NULL ); CMBaseEntity *pSmoker = CreateClassPtr((CSmoker *)NULL); // CMBaseEntity::Create( "env_smoker", pev->origin, g_vecZero, NULL );
UTIL_SetOrigin( pSmoker->pev, pev->origin );
pSmoker->Spawn();
pSmoker->pev->health = 1; // 1 smoke balls pSmoker->pev->health = 1; // 1 smoke balls
pSmoker->pev->scale = 46; // 4.6X normal size pSmoker->pev->scale = 46; // 4.6X normal size
pSmoker->pev->dmg = 0; // 0 radial distribution pSmoker->pev->dmg = 0; // 0 radial distribution
@@ -1199,7 +1201,7 @@ CSpiral *CSpiral::Create( const Vector &origin, float height, float radius, floa
{ {
if ( duration <= 0 ) if ( duration <= 0 )
return NULL; return NULL;
CSpiral *pSpiral = CreateClassPtr( (CSpiral *)NULL ); CSpiral *pSpiral = CreateClassPtr( (CSpiral *)NULL );
pSpiral->Spawn(); pSpiral->Spawn();
pSpiral->pev->dmgtime = pSpiral->pev->nextthink; pSpiral->pev->dmgtime = pSpiral->pev->nextthink;