halflife icon indicating copy to clipboard operation
halflife copied to clipboard

[TFC] Func_tankrocket

Open tehORiON opened this issue 13 years ago • 4 comments

Using the "func_tankrocket" in a tfc map will make it crash when it tries to fire. The error occurs in this function:

void CFuncTankRocket::Fire( const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker )
{
    int i;

    if ( m_fireLast != 0 )
    {
        int bulletCount = (gpGlobals->time - m_fireLast) * m_fireRate;
        if ( bulletCount > 0 )
        {
            for ( i = 0; i < bulletCount; i++ )
            {
                CBaseEntity *pRocket = CBaseEntity::Create( "rpg_rocket", barrelEnd, pev->angles, edict() );
            }
            CFuncTank::Fire( barrelEnd, forward, pev );
        }
    }
    else
        CFuncTank::Fire( barrelEnd, forward, pev );
}

This line:

CBaseEntity *pRocket = CBaseEntity::Create( "rpg_rocket", barrelEnd, pev->angles, edict() );

It tries to instantiate the "rpg_rocket" entity which is not included in TFC from halflife. TFC instead uses it's own version "tf_rpg_rocket".

tehORiON avatar Aug 08 '13 22:08 tehORiON

Could you link a custom map that has this entity so I can test this.

alfred-valve avatar Aug 08 '13 22:08 alfred-valve

@alfred-valve Yes, I just mapped one for you: http://www.sendspace.com/file/451y02

tehORiON avatar Aug 08 '13 22:08 tehORiON

Using this entity still causes a crash even after it was supposed to be fixed in the last update.

To test this: load the Half-Life "Surface Tension" map C2A5B, there is a func_tankrocket entity after you open the doors (after blowing up the func_tank).

Please create a custom projectile entity for this weapon, like the way the func_mortarfield entity has its own custom explosive entity. Please name this projectile something other than "tf_rpg_rocket" to differentiate it from normal Player fired RPG rockets. Maybe func_tank_rocket or something.

SpannerSpammer avatar Sep 05 '13 05:09 SpannerSpammer

It doesn't crash, you will crash however if you destroy some of the crates, think it's because they spawn an invalid item. But anyway the func_tankrocket doesn't really work, it just fires a model of a rocket and nothing happens. I suggest exporting the original functions RPG functions for it and using rpg_rocket.

tehORiON avatar Sep 05 '13 08:09 tehORiON